A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient below:

azure.storage.blob.ContainerClient class | Microsoft Learn

ContainerClient Class

A client to interact with a specific container, although that container may not yet exist.

For operations relating to a specific blob within this container, a blob client can be retrieved using the get_blob_client function.

For more optional configuration, please click here.

Constructor
ContainerClient(account_url: str, container_name: str, credential: str | Dict[str, str] | AzureNamedKeyCredential | AzureSasCredential | TokenCredential | None = None, **kwargs: Any)
Parameters Keyword-Only Parameters Methods acquire_lease

Requests a new lease. If the container does not have an active lease, the Blob service creates a lease on the container and returns a new lease ID.

close

This method is to close the sockets opened by the client. It need not be used when using with a context manager.

create_container

Creates a new container under the specified account. If the container with the same name already exists, the operation fails.

delete_blob

Marks the specified blob or snapshot for deletion.

The blob is later deleted during garbage collection. Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time with the delete_blob operation.

If a delete retention policy is enabled for the service, then this operation soft deletes the blob or snapshot and retains the blob or snapshot for specified number of days. After specified number of days, blob's data is removed from the service during garbage collection. Soft deleted blob or snapshot is accessible through list_blobs specifying include=["deleted"] option. Soft-deleted blob or snapshot can be restored using <xref:azure.storage.blob.BlobClient.undelete>

delete_blobs

Marks the specified blobs or snapshots for deletion.

The blobs are later deleted during garbage collection. Note that in order to delete blobs, you must delete all of their snapshots. You can delete both at the same time with the delete_blobs operation.

If a delete retention policy is enabled for the service, then this operation soft deletes the blobs or snapshots and retains the blobs or snapshots for specified number of days. After specified number of days, blobs' data is removed from the service during garbage collection. Soft deleted blobs or snapshots are accessible through list_blobs specifying include=["deleted"] Soft-deleted blobs or snapshots can be restored using <xref:azure.storage.blob.BlobClient.undelete>

The maximum number of blobs that can be deleted in a single request is 256.

delete_container

Marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.

download_blob

Downloads a blob to the StorageStreamDownloader. The readall() method must be used to read all the content or readinto() must be used to download the blob into a stream. Using chunks() returns an iterator which allows the user to iterate over the content in chunks.

exists

Returns True if a container exists and returns False otherwise.

find_blobs_by_tags

Returns a generator to list the blobs under the specified container whose tags match the given search expression. The generator will lazily follow the continuation tokens returned by the service.

from_connection_string

Create ContainerClient from a Connection String.

from_container_url

Create ContainerClient from a container url.

get_account_information

Gets information related to the storage account.

The information can also be retrieved if the user has a SAS to a container or blob. The keys in the returned dictionary include 'sku_name' and 'account_kind'.

get_blob_client

Get a client to interact with the specified blob.

The blob need not already exist.

get_container_access_policy

Gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.

get_container_properties

Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.

list_blob_names

Returns a generator to list the names of blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service.

Note that no additional properties or metadata will be returned when using this API. Additionally, this API does not have an option to include additional blobs such as snapshots, versions, soft-deleted blobs, etc. To get any of this data, use list_blobs.

list_blobs

Returns a generator to list the blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service.

set_container_access_policy

Sets the permissions for the specified container or stored access policies that may be used with Shared Access Signatures. The permissions indicate whether blobs in a container may be accessed publicly.

set_container_metadata

Sets one or more user-defined name-value pairs for the specified container. Each call to this operation replaces all existing metadata attached to the container. To remove all metadata from the container, call this operation with no metadata dict.

set_premium_page_blob_tier_blobs

Sets the page blob tiers on all blobs. This API is only supported for page blobs on premium accounts.

The maximum number of blobs that can be updated in a single request is 256.

set_standard_blob_tier_blobs

This operation sets the tier on block blobs.

A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.

The maximum number of blobs that can be updated in a single request is 256.

upload_blob

Creates a new blob from a data source with automatic chunking.

walk_blobs

Returns a generator to list the blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service. This operation will list blobs in accordance with a hierarchy, as delimited by the specified delimiter character.

acquire_lease

Requests a new lease. If the container does not have an active lease, the Blob service creates a lease on the container and returns a new lease ID.

acquire_lease(lease_duration: int = -1, lease_id: str | None = None, **kwargs: Any) -> BlobLeaseClient
Parameters Keyword-Only Parameters Returns close

This method is to close the sockets opened by the client. It need not be used when using with a context manager.

close()
create_container

Creates a new container under the specified account. If the container with the same name already exists, the operation fails.

create_container(metadata: Dict[str, str] | None = None, public_access: PublicAccess | str | None = None, **kwargs: Any) -> Dict[str, str | datetime]
Parameters Keyword-Only Parameters Returns delete_blob

Marks the specified blob or snapshot for deletion.

The blob is later deleted during garbage collection. Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time with the delete_blob operation.

If a delete retention policy is enabled for the service, then this operation soft deletes the blob or snapshot and retains the blob or snapshot for specified number of days. After specified number of days, blob's data is removed from the service during garbage collection. Soft deleted blob or snapshot is accessible through list_blobs specifying include=["deleted"] option. Soft-deleted blob or snapshot can be restored using <xref:azure.storage.blob.BlobClient.undelete>

delete_blob(blob: str, delete_snapshots: str | None = None, **kwargs: Any) -> None
Parameters Keyword-Only Parameters Returns delete_blobs

Marks the specified blobs or snapshots for deletion.

The blobs are later deleted during garbage collection. Note that in order to delete blobs, you must delete all of their snapshots. You can delete both at the same time with the delete_blobs operation.

If a delete retention policy is enabled for the service, then this operation soft deletes the blobs or snapshots and retains the blobs or snapshots for specified number of days. After specified number of days, blobs' data is removed from the service during garbage collection. Soft deleted blobs or snapshots are accessible through list_blobs specifying include=["deleted"] Soft-deleted blobs or snapshots can be restored using <xref:azure.storage.blob.BlobClient.undelete>

The maximum number of blobs that can be deleted in a single request is 256.

delete_blobs(*blobs: str | Dict[str, Any] | BlobProperties, **kwargs: Any) -> Iterator[HttpResponse]
Parameters Keyword-Only Parameters Returns delete_container

Marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.

delete_container(**kwargs: Any) -> None
Keyword-Only Parameters Returns download_blob

Downloads a blob to the StorageStreamDownloader. The readall() method must be used to read all the content or readinto() must be used to download the blob into a stream. Using chunks() returns an iterator which allows the user to iterate over the content in chunks.

download_blob(blob: str, offset: int | None = None, length: int | None = None, *, encoding: str, **kwargs: Any) -> StorageStreamDownloader[str]
Parameters Keyword-Only Parameters Returns exists

Returns True if a container exists and returns False otherwise.

exists(**kwargs: Any) -> bool
Keyword-Only Parameters Returns find_blobs_by_tags

Returns a generator to list the blobs under the specified container whose tags match the given search expression. The generator will lazily follow the continuation tokens returned by the service.

find_blobs_by_tags(filter_expression: str, **kwargs: Any) -> ItemPaged[FilteredBlob]
Parameters Keyword-Only Parameters Returns from_connection_string

Create ContainerClient from a Connection String.

from_connection_string(conn_str: str, container_name: str, credential: str | Dict[str, str] | AzureNamedKeyCredential | AzureSasCredential | TokenCredential | None = None, **kwargs: Any) -> Self
Parameters Keyword-Only Parameters Returns from_container_url

Create ContainerClient from a container url.

from_container_url(container_url: str, credential: str | Dict[str, str] | AzureNamedKeyCredential | AzureSasCredential | TokenCredential | None = None, **kwargs: Any) -> Self
Parameters Keyword-Only Parameters Returns get_account_information

Gets information related to the storage account.

The information can also be retrieved if the user has a SAS to a container or blob. The keys in the returned dictionary include 'sku_name' and 'account_kind'.

get_account_information(**kwargs: Any) -> Dict[str, str]
Returns get_blob_client

Get a client to interact with the specified blob.

The blob need not already exist.

get_blob_client(blob: str, snapshot: str | None = None, *, version_id: str | None = None) -> BlobClient
Parameters Keyword-Only Parameters Returns get_container_access_policy

Gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.

get_container_access_policy(**kwargs: Any) -> Dict[str, Any]
Keyword-Only Parameters Returns get_container_properties

Returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.

get_container_properties(**kwargs: Any) -> ContainerProperties
Keyword-Only Parameters Returns list_blob_names

Returns a generator to list the names of blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service.

Note that no additional properties or metadata will be returned when using this API. Additionally, this API does not have an option to include additional blobs such as snapshots, versions, soft-deleted blobs, etc. To get any of this data, use list_blobs.

list_blob_names(**kwargs: Any) -> ItemPaged[str]
Keyword-Only Parameters Returns list_blobs

Returns a generator to list the blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service.

list_blobs(name_starts_with: str | None = None, include: str | List[str] | None = None, **kwargs: Any) -> ItemPaged[BlobProperties]
Parameters Keyword-Only Parameters Returns set_container_access_policy

Sets the permissions for the specified container or stored access policies that may be used with Shared Access Signatures. The permissions indicate whether blobs in a container may be accessed publicly.

set_container_access_policy(signed_identifiers: Dict[str, AccessPolicy], public_access: PublicAccess | str | None = None, **kwargs: Any) -> Dict[str, str | datetime]
Parameters Keyword-Only Parameters Returns set_container_metadata

Sets one or more user-defined name-value pairs for the specified container. Each call to this operation replaces all existing metadata attached to the container. To remove all metadata from the container, call this operation with no metadata dict.

set_container_metadata(metadata: Dict[str, str] | None = None, **kwargs: Any) -> Dict[str, str | datetime]
Parameters Keyword-Only Parameters Returns set_premium_page_blob_tier_blobs

Sets the page blob tiers on all blobs. This API is only supported for page blobs on premium accounts.

The maximum number of blobs that can be updated in a single request is 256.

set_premium_page_blob_tier_blobs(premium_page_blob_tier: str | PremiumPageBlobTier | None, *blobs: str | Dict[str, Any] | BlobProperties, **kwargs: Any) -> Iterator[HttpResponse]
Parameters Keyword-Only Parameters Returns set_standard_blob_tier_blobs

This operation sets the tier on block blobs.

A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.

The maximum number of blobs that can be updated in a single request is 256.

set_standard_blob_tier_blobs(standard_blob_tier: str | StandardBlobTier | None, *blobs: str | Dict[str, Any] | BlobProperties, **kwargs: Any) -> Iterator[HttpResponse]
Parameters Keyword-Only Parameters Returns upload_blob

Creates a new blob from a data source with automatic chunking.

upload_blob(name: str, data: bytes | str | Iterable | IO, blob_type: str | BlobType = BlobType.BLOCKBLOB, length: int | None = None, metadata: Dict[str, str] | None = None, **kwargs) -> BlobClient
Parameters Keyword-Only Parameters Returns walk_blobs

Returns a generator to list the blobs under the specified container. The generator will lazily follow the continuation tokens returned by the service. This operation will list blobs in accordance with a hierarchy, as delimited by the specified delimiter character.

walk_blobs(name_starts_with: str | None = None, include: str | List[str] | None = None, delimiter: str = '/', **kwargs: Any) -> ItemPaged[BlobProperties]
Parameters Keyword-Only Parameters Returns Attributes api_version

The version of the Storage API used for requests.

Returns location_mode

The location mode that the client is currently using.

By default this will be "primary". Options include "primary" and "secondary".

Returns primary_endpoint

The full primary endpoint URL.

Returns primary_hostname

The hostname of the primary endpoint.

Returns secondary_endpoint

The full secondary endpoint URL if configured.

If not available a ValueError will be raised. To explicitly specify a secondary hostname, use the optional secondary_hostname keyword argument on instantiation.

Returns Exceptions secondary_hostname

The hostname of the secondary endpoint.

If not available this will be None. To explicitly specify a secondary hostname, use the optional secondary_hostname keyword argument on instantiation.

Returns url

The full endpoint URL to this entity, including SAS token if used.

This could be either the primary endpoint, or the secondary endpoint depending on the current location_mode. :returns: The full endpoint URL to this entity, including SAS token if used. :rtype: str


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4