Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ from ._quick_query_helper import BlobQueryReader
from ._shared.base_client import StorageAccountHostsMixin

class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin):
container_name: str
blob_name: str
snapshot: Optional[str]
version_id: Optional[str]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class BlobClient( # type: ignore[misc]
StorageAccountHostsMixin,
StorageEncryptionMixin,
):
container_name: str
blob_name: str
snapshot: Optional[str]
version_id: Optional[str]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,19 @@ def block_blob_sample(self):

# Instantiate a new ContainerClient
container_client = blob_service_client.get_container_client("myblockcontainersync1")
container_client.account_name
container_client.container_name

try:
# Create new Container in the service
container_client.create_container()

# Instantiate a new BlobClient
blob_client = container_client.get_blob_client("myblockblob")
blob_client.container_name
blob_client.blob_name
blob_client.snapshot
blob_client.api_version

# [START upload_a_blob]
# Upload content to block blob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,19 @@ async def block_blob_sample_async(self):
async with blob_service_client:
# Instantiate a new ContainerClient
container_client = blob_service_client.get_container_client("myblockcontainerasync1")
container_client.account_name
container_client.container_name

try:
# Create new Container in the service
await container_client.create_container()

# Instantiate a new BlobClient
blob_client = container_client.get_blob_client("myblockblob")
blob_client.container_name
blob_client.blob_name
blob_client.snapshot
blob_client.api_version

# [START upload_a_blob]
# Upload content to block blob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ from ._models import (
from ._shared.base_client import StorageAccountHostsMixin

class ShareDirectoryClient(StorageAccountHostsMixin):
share_name: str
directory_path: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ from ._models import (
from ._shared.base_client import StorageAccountHostsMixin

class ShareFileClient(StorageAccountHostsMixin):
share_name: str
file_name: str
file_path: List[str]
directory_path: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ from ._models import (
from ._shared.base_client import StorageAccountHostsMixin

class ShareClient(StorageAccountHostsMixin):
share_name: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ from .._shared.base_client import StorageAccountHostsMixin
from .._shared.base_client_async import AsyncStorageAccountHostsMixin

class ShareDirectoryClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin): # type: ignore [misc]
share_name: str
directory_path: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ from .._shared.base_client import StorageAccountHostsMixin
from .._shared.base_client_async import AsyncStorageAccountHostsMixin

class ShareFileClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin): # type: ignore [misc]
share_name: str
file_name: str
file_path: List[str]
directory_path: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ from .._shared.base_client import StorageAccountHostsMixin
from .._shared.base_client_async import AsyncStorageAccountHostsMixin

class ShareClient(AsyncStorageAccountHostsMixin, StorageAccountHostsMixin): # type: ignore[misc]
share_name: str
snapshot: Optional[str]
allow_trailing_dot: Optional[bool]
allow_source_trailing_dot: Optional[bool]
file_request_intent: Optional[Literal["backup"]]
def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def create_directory_and_file(self):
try:
# Get the directory client
my_directory = share.get_directory_client(directory_path="mydirectory")
my_directory.share_name
my_directory.directory_path
my_directory.snapshot
my_directory.allow_trailing_dot
my_directory.allow_source_trailing_dot
my_directory.file_request_intent

# [START create_directory]
my_directory.create_directory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ async def create_directory_and_file_async(self):
try:
# Get the directory client
directory = share.get_directory_client(directory_path="mydirectory")
directory.share_name
directory.directory_path
directory.snapshot
directory.allow_trailing_dot
directory.allow_source_trailing_dot
directory.file_request_intent

# [START create_directory]
await directory.create_directory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,16 @@ def upload_a_file_to_share(self):
file = ShareFileClient.from_connection_string(
self.connection_string,
share_name="helloworld2",
file_path="myfile")
file_path="myfile"
)
file.share_name
file.file_name
file.file_path
file.directory_path
file.snapshot
file.allow_trailing_dot
file.allow_source_trailing_dot
file.file_request_intent
# [END create_file_client]

# Upload a file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ async def upload_a_file_to_share_async(self):
file = ShareFileClient.from_connection_string(
self.connection_string,
share_name='helloworld2async',
file_path="myfile")
file_path="myfile"
)
file.share_name
file.file_name
file.file_path
file.directory_path
file.snapshot
file.allow_trailing_dot
file.allow_source_trailing_dot
file.file_request_intent
# [END create_file_client]

# Upload a file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def create_share_snapshot(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "sharesamples1")
share.share_name
share.snapshot
share.allow_trailing_dot
share.allow_source_trailing_dot
share.file_request_intent

# [START create_share]
# Create share with Access Tier set to Hot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ async def create_share_snapshot_async(self):
# Instantiate the ShareClient from a connection string
from azure.storage.fileshare.aio import ShareClient
share = ShareClient.from_connection_string(self.connection_string, "sharesamples1async")
share.share_name
share.snapshot
share.allow_trailing_dot
share.allow_source_trailing_dot
share.file_request_intent

async with share:
# [START create_share]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class QueueClient(StorageAccountHostsMixin, StorageEncryptionMixin):
:caption: Create the queue client with url and credential.
"""

queue_name: str

def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class QueueClient( # type: ignore [misc]
:caption: Create the queue client with a connection string.
"""

queue_name: str

def __init__(
self,
account_url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def queue_and_messages_example(self):
from azure.storage.queue import QueueClient

queue = QueueClient.from_connection_string(conn_str=self.connection_string, queue_name="myqueue")
queue.queue_name

# Create the queue
# [START create_queue]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async def queue_and_messages_example_async(self):
from azure.storage.queue.aio import QueueClient

queue = QueueClient.from_connection_string(conn_str=self.connection_string, queue_name="asyncmyqueue")
queue.queue_name

async with queue:
# Create the queue
Expand Down