Update azure_rm_storageaccount related document (#58313)

* Update azure_rm_storageaccount and azure_rm_storageblob module documentation
pull/58608/head
Fred-sun 5 years ago committed by Alicia Cozine
parent 3a919d4bec
commit c86c079837

@ -18,7 +18,7 @@ DOCUMENTATION = '''
---
module: azure_rm_storageaccount
version_added: "2.1"
short_description: Manage Azure storage accounts.
short_description: Manage Azure storage accounts
description:
- Create, update or delete a storage account.
options:
@ -33,20 +33,19 @@ options:
- Name of the storage account to update or create.
state:
description:
- Assert the state of the storage account. Use C(present) to create or update a storage account and
C(absent) to delete an account.
- State of the storage account. Use C(present) to create or update a storage account and use C(absent) to delete an account.
default: present
choices:
- absent
- present
location:
description:
- Valid azure location. Defaults to location of the resource group.
- Valid Azure location. Defaults to location of the resource group.
account_type:
description:
- "Type of storage account. Required when creating a storage account. NOTE: Standard_ZRS and Premium_LRS
accounts cannot be changed to other account types, and other account types cannot be changed to
Standard_ZRS or Premium_LRS."
- Type of storage account. Required when creating a storage account.
- C(Standard_ZRS) and C(Premium_LRS) accounts cannot be changed to other account types.
- Other account types cannot be changed to C(Standard_ZRS) or C(Premium_LRS).
choices:
- Premium_LRS
- Standard_GRS
@ -59,15 +58,16 @@ options:
- type
custom_domain:
description:
- User domain assigned to the storage account. Must be a dictionary with 'name' and 'use_sub_domain'
keys where 'name' is the CNAME source. Only one custom domain is supported per storage account at this
time. To clear the existing custom domain, use an empty string for the custom domain name property.
- User domain assigned to the storage account.
- Must be a dictionary with I(name) and I(use_sub_domain) keys where I(name) is the CNAME source.
- Only one custom domain is supported per storage account at this time.
- To clear the existing custom domain, use an empty string for the custom domain name property.
- Can be added to an existing storage account. Will be ignored during storage account creation.
aliases:
- custom_dns_domain_suffix
kind:
description:
- The 'kind' of storage.
- The kind of storage.
default: 'Storage'
choices:
- Storage
@ -76,20 +76,20 @@ options:
version_added: "2.2"
access_tier:
description:
- The access tier for this storage account. Required for a storage account of kind 'BlobStorage'.
- The access tier for this storage account. Required when I(kind=BlobStorage).
choices:
- Hot
- Cool
version_added: "2.4"
force_delete_nonempty:
description:
- Attempt deletion if resource already exists and cannot be updated
- Attempt deletion if resource already exists and cannot be updated.
type: bool
aliases:
- force
https_only:
description:
- Allows https traffic only to storage service if sets to true.
- Allows https traffic only to storage service when set to C(true).
type: bool
version_added: "2.8"
blob_cors:
@ -97,7 +97,7 @@ options:
- Specifies CORS rules for the Blob service.
- You can include up to five CorsRule elements in the request.
- If no blob_cors elements are included in the argument list, nothing about CORS will be changed.
- "If you want to delete all CORS rules and disable CORS for the Blob service, explicitly set blob_cors: []."
- If you want to delete all CORS rules and disable CORS for the Blob service, explicitly set I(blob_cors=[]).
type: list
version_added: "2.8"
suboptions:
@ -132,8 +132,8 @@ extends_documentation_fragment:
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
- "Matt Davis (@nitzmahone)"
- Chris Houseknecht (@chouseknecht)
- Matt Davis (@nitzmahone)
'''
EXAMPLES = '''
@ -175,34 +175,122 @@ EXAMPLES = '''
RETURN = '''
state:
description: Current state of the storage account.
description:
- Current state of the storage account.
returned: always
type: dict
sample: {
"account_type": "Standard_RAGRS",
"custom_domain": null,
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/clh0003",
"location": "eastus2",
"name": "clh0003",
"primary_endpoints": {
"blob": "https://clh0003.blob.core.windows.net/",
"queue": "https://clh0003.queue.core.windows.net/",
"table": "https://clh0003.table.core.windows.net/"
},
"primary_location": "eastus2",
"provisioning_state": "Succeeded",
"resource_group": "Testing",
"secondary_endpoints": {
"blob": "https://clh0003-secondary.blob.core.windows.net/",
"queue": "https://clh0003-secondary.queue.core.windows.net/",
"table": "https://clh0003-secondary.table.core.windows.net/"
},
"secondary_location": "centralus",
"status_of_primary": "Available",
"status_of_secondary": "Available",
"tags": null,
"type": "Microsoft.Storage/storageAccounts"
}
type: complex
contains:
account_type:
description:
- Type of storage account.
returned: always
type: str
sample: Standard_RAGRS
custom_domain:
description:
- User domain assigned to the storage account.
returned: always
type: complex
contains:
name:
description:
- CNAME source.
returned: always
type: str
sample: testaccount
use_sub_domain:
description:
- Whether to use sub domain.
returned: always
type: bool
sample: true
id:
description:
- Resource ID.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/clh0003"
location:
description:
- Valid Azure location. Defaults to location of the resource group.
returned: always
type: str
sample: eastus2
name:
description:
- Name of the storage account to update or create.
returned: always
type: str
sample: clh0003
primary_endpoints:
description:
- The URLs to retrieve the public I(blob), I(queue), or I(table) object from the primary location.
returned: always
type: dict
sample: {
"blob": "https://clh0003.blob.core.windows.net/",
"queue": "https://clh0003.queue.core.windows.net/",
"table": "https://clh0003.table.core.windows.net/"
}
primary_location:
description:
- The location of the primary data center for the storage account.
returned: always
type: str
sample: eastus2
provisioning_state:
description:
- The status of the storage account.
- Possible values include C(Creating), C(ResolvingDNS), C(Succeeded).
returned: always
type: str
sample: Succeeded
resource_group:
description:
- The resource group's name.
returned: always
type: str
sample: Testing
secondary_endpoints:
description:
- The URLs to retrieve the public I(blob), I(queue), or I(table) object from the secondary location.
returned: always
type: dict
sample: {
"blob": "https://clh0003-secondary.blob.core.windows.net/",
"queue": "https://clh0003-secondary.queue.core.windows.net/",
"table": "https://clh0003-secondary.table.core.windows.net/"
}
secondary_location:
description:
- The location of the geo-replicated secondary for the storage account.
returned: always
type: str
sample: centralus
status_of_primary:
description:
- The status of the primary location of the storage account; either C(available) or C(unavailable).
returned: always
type: str
sample: available
status_of_secondary:
description:
- The status of the secondary location of the storage account; either C(available) or C(unavailable).
returned: always
type: str
sample: available
tags:
description:
- Resource tags.
returned: always
type: dict
sample: { 'tags1': 'value1' }
type:
description:
- The storage account type.
returned: always
type: str
sample: "Microsoft.Storage/storageAccounts"
'''
try:

@ -20,7 +20,7 @@ module: azure_rm_storageaccount_facts
version_added: "2.1"
short_description: Get storage account facts.
short_description: Get storage account facts
description:
- Get facts for one storage account or all storage accounts within a resource group.
@ -46,8 +46,8 @@ options:
version_added: "2.8"
show_blob_cors:
description:
- Show the blob CORS settings for each of the storageaccount's blob.
- Note that it will cost a lot time when list all storageaccount rather than querry a single one.
- Show the blob CORS settings for each blob related to the storage account.
- Querying all storage accounts will take a long time.
type: bool
version_added: "2.8"
@ -55,8 +55,8 @@ extends_documentation_fragment:
- azure
author:
- "Chris Houseknecht (@chouseknecht)"
- "Matt Davis (@nitzmahone)"
- Chris Houseknecht (@chouseknecht)
- Matt Davis (@nitzmahone)
'''
@ -79,7 +79,8 @@ EXAMPLES = '''
RETURN = '''
azure_storageaccounts:
description: List of storage account dicts.
description:
- List of storage account dicts.
returned: always
type: list
example: [{
@ -103,170 +104,234 @@ azure_storageaccounts:
"type": "Microsoft.Storage/storageAccounts"
}]
storageaccounts:
description: List of storage account dicts in resource module's parameter format.
description:
- List of storage account dicts in resource module's parameter format.
returned: always
type: complex
contains:
id:
description:
- Resource ID.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/t
estaccount001"
name:
description:
- Name of the storage account to update or create.
sample: "testaccount001"
returned: always
type: str
sample: testaccount001
location:
description:
- Valid azure location. Defaults to location of the resource group.
- Valid Azure location. Defaults to location of the resource group.
returned: always
type: str
sample: eastus
account_type:
description:
- Type of storage account.
- "NOTE: Standard_ZRS and Premium_LRS accounts cannot be changed to other account types."
- Other account types cannot be changed to Standard_ZRS or Premium_LRS.
- C(Standard_ZRS) and C(Premium_LRS) accounts cannot be changed to other account types.
- Other account types cannot be changed to C(Standard_ZRS) or C(Premium_LRS).
returned: always
type: str
sample: Standard_ZRS
custom_domain:
description:
- User domain assigned to the storage account.
- Must be a dictionary with 'name' and 'use_sub_domain' keys where 'name' is the CNAME source.
- Must be a dictionary with I(name) and I(use_sub_domain) keys where I(name) is the CNAME source.
returned: always
type: complex
contains:
name:
description:
- CNAME source.
returned: always
type: str
sample: testaccount
use_sub_domain:
description:
- whether to use sub domain.
- Whether to use sub domain.
returned: always
type: bool
sample: true
kind:
description:
- The 'kind' of storage.
- The kind of storage.
returned: always
type: str
sample: Storage
access_tier:
description:
- The access tier for this storage account.
returned: always
type: str
sample: Hot
https_only:
description:
- Allows https traffic only to storage service if sets to true.
- Allows https traffic only to storage service when set to C(true).
returned: always
type: bool
sample: false
provisioning_state:
description:
- Gets the status of the storage account at the time the operation was called.
- Possible values include 'Creating', 'ResolvingDNS', 'Succeeded'.
- The status of the storage account at the time the operation was called.
- Possible values include C(Creating), C(ResolvingDNS), C(Succeeded).
returned: always
type: str
sample: Succeeded
secondary_location:
description:
- Gets the location of the geo-replicated secondary for the storage account.
- Only available if the accountType is Standard_GRS or Standard_RAGRS.
- The location of the geo-replicated secondary for the storage account.
- Only available if the I(account_type=Standard_GRS) or I(account_type=Standard_RAGRS).
returned: always
type: str
sample: westus
status_of_primary:
description:
- Gets the status indicating whether the primary location of the storage account is available or unavailable.
- Status of the primary location of the storage account; either C(available) or C(unavailable).
returned: always
type: str
sample: available
status_of_secondary:
description:
- Gets the status indicating whether the secondary location of the storage account is available or unavailable.
- Status of the secondary location of the storage account; either C(available) or C(unavailable).
returned: always
type: str
sample: available
primary_location:
description:
- Gets the location of the primary data center for the storage account.
- The location of the primary data center for the storage account.
returned: always
type: str
sample: eastus
primary_endpoints:
description:
- Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object.
- Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.
- URLs to retrieve a public I(blob), I(queue), or I(table) object.
- Note that C(Standard_ZRS) and C(Premium_LRS) accounts only return the blob endpoint.
returned: always
type: complex
contains:
blob:
description:
- Gets the primary blob endpoint and connection string.
- The primary blob endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the primary blob endpoint.
- The primary blob endpoint.
returned: always
type: str
sample: "https://testaccount001.blob.core.windows.net/"
connectionstring:
description:
- Connectionstring of the blob endpoint
- Connectionstring of the blob endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;BlobEndpoint=X"
queue:
description:
- Gets the primary queue endpoint and connection string.
- The primary queue endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the primary queue endpoint.
- The primary queue endpoint.
returned: always
type: str
sample: "https://testaccount001.queue.core.windows.net/"
connectionstring:
description:
- Connectionstring of the queue endpoint
- Connectionstring of the queue endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;QueueEndpoint=X"
table:
description:
- Gets the primary table endpoint and connection string.
- The primary table endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the primary table endpoint.
- The primary table endpoint.
returned: always
type: str
sample: "https://testaccount001.table.core.windows.net/"
connectionstring:
description:
- Connectionstring of the table endpoint
- Connectionstring of the table endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X"
key:
description:
- The account key for the primary_endpoints
returned: always
type: str
sample: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
secondary_endpoints:
description:
- Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location.
- Only available if the SKU name is Standard_RAGRS.
- The URLs to retrieve a public I(blob), I(queue), or I(table) object from the secondary location.
- Only available if the SKU I(name=Standard_RAGRS).
returned: always
type: complex
contains:
blob:
description:
- Gets the secondary blob endpoint and connection string.
- The secondary blob endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the secondary blob endpoint.
- The secondary blob endpoint.
returned: always
type: str
sample: "https://testaccount001.blob.core.windows.net/"
connectionstring:
description:
- Connectionstring of the blob endpoint
- Connectionstring of the blob endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;BlobEndpoint=X"
queue:
description:
- Gets the secondary queue endpoint and connection string.
- The secondary queue endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the secondary queue endpoint.
- The secondary queue endpoint.
returned: always
type: str
sample: "https://testaccount001.queue.core.windows.net/"
connectionstring:
description:
- Connectionstring of the queue endpoint
- Connectionstring of the queue endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;QueueEndpoint=X"
table:
description:
- Gets the secondary table endpoint and connection string.
- The secondary table endpoint and connection string.
returned: always
type: complex
contains:
endpoint:
description:
- Gets the secondary table endpoint.
- The secondary table endpoint.
returned: always
type: str
sample: "https://testaccount001.table.core.windows.net/"
connectionstring:
description:
- Connectionstring of the table endpoint
- Connectionstring of the table endpoint.
returned: always
type: str
sample: "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=X;AccountKey=X;TableEndpoint=X"
key:
description:
@ -275,12 +340,9 @@ storageaccounts:
tags:
description:
- Resource tags.
returned: always
type: dict
sample: { "tag1": "abc" }
blob_cors:
description:
- Blob CORS of blob.
type: list
'''
try:

@ -17,11 +17,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_storageblob
short_description: Manage blob containers and blob objects.
short_description: Manage blob containers and blob objects
version_added: "2.1"
description:
- Create, update and delete blob containers and blob objects. Use to upload a file and store it as a blob object,
or download a blob object to a file.
- Create, update and delete blob containers and blob objects.
- Use to upload a file and store it as a blob object, or download a blob object to a file.
options:
storage_account_name:
description:
@ -37,7 +37,7 @@ options:
- blob_name
blob_type:
description:
- Type of Blob Object.
- Type of blob object.
default: block
choices:
- block
@ -51,7 +51,7 @@ options:
- container_name
content_type:
description:
- Set the blob content-type header. For example, 'image/png'.
- Set the blob content-type header. For example C(image/png).
cache_control:
description:
- Set the blob cache-control header.
@ -74,8 +74,7 @@ options:
- destination
force:
description:
- Overwrite existing blob or file when uploading or downloading. Force deletion of a container
that contains blobs.
- Overwrite existing blob or file when uploading or downloading. Force deletion of a container that contains blobs.
type: bool
default: no
resource_group:
@ -91,23 +90,23 @@ options:
- source
state:
description:
- Assert the state of a container or blob.
- State of a container or blob.
- Use state C(absent) with a container value only to delete a container. Include a blob value to remove
a specific blob. A container will not be deleted, if it contains blobs. Use the force option to override,
a specific blob. A container will not be deleted, if it contains blobs. Use the I(force) option to override,
deleting the container and all associated blobs.
- Use state C(present) to create or update a container and upload or download a blob. If the container
does not exist, it will be created. If it exists, it will be updated with configuration options. Provide
a blob name and either src or dest to upload or download. Provide a src path to upload and a dest path
to download. If a blob (uploading) or a file (downloading) already exists, it will not be overwritten
unless the force parameter is true.
unless I(force=true).
default: present
choices:
- absent
- present
public_access:
description:
- Determine a container's level of public access. By default containers are private. Can only be set at
time of container creation.
- A container's level of public access. By default containers are private.
- Can only be set at time of container creation.
choices:
- container
- blob
@ -117,8 +116,8 @@ extends_documentation_fragment:
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
- "Matt Davis (@nitzmahone)"
- Chris Houseknecht (@chouseknecht)
- Matt Davis (@nitzmahone)
'''
@ -151,7 +150,8 @@ EXAMPLES = '''
RETURN = '''
blob:
description: Facts about the current state of the blob.
description:
- Facts about the current state of the blob.
returned: when a blob is operated on
type: dict
sample: {
@ -170,7 +170,8 @@ blob:
"type": "BlockBlob"
}
container:
description: Facts about the current state of the selected container.
description:
- Facts about the current state of the selected container.
returned: always
type: dict
sample: {

Loading…
Cancel
Save