C# Класс Google.PowerShell.CloudStorage.GoogleCloudStorageProvider

Наследование: System.Management.Automation.Provider.NavigationCmdletProvider, IContentCmdletProvider
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
DeleteObjects void
GetBucketModel BucketModel
GetChildItemBucketHelper void
GetContentStream Stream
GetNewService StorageService
ListAllProjects IEnumerable
ListBucketsAsync System.Threading.Tasks.Task
ListChildren IEnumerable
NewBucket Bucket
NewObject Google.Apis.Storage.v1.Data.Object
NewTelemetryReporter IReportCmdletResults
PerformActionOnBucketAndOptionallyUpdateCache void
RemoveBucket void
RemoveFolder void
UpdateBucketCacheAndPerformActionOnBucket Bucket>.Dictionary
WaitDeleteTasks void

Открытые методы

Метод Описание
ClearContent ( string path ) : void

Clears the content of an object. Used by Clear-Content.

ClearContentDynamicParameters ( string path ) : object
GetContentReader ( string path ) : IContentReader

Gets a content reader to read the contents of a downloaded Google Cloud Storage object. Used by Get-Contents.

GetContentReaderDynamicParameters ( string path ) : object

Required by IContentCmdletProvider, along with GetContentReader(string). Returns null because we have no need for dynamic parameters on Get-Content.

GetContentWriter ( string path ) : IContentWriter

Gets a writer used to upload data to a Google Cloud Storage object. Used by Set-Content.

GetContentWriterDynamicParameters ( string path ) : object

Защищенные методы

Метод Описание
CopyItem ( string path, string copyPath, bool recurse ) : void

Copies a Google Cloud Storage object or folder to another object or folder. Used by Copy-Item.

CopyItemDynamicParameters ( string path, string destination, bool recurse ) : object
GetChildItems ( string path, bool recurse ) : void

Writes the object descriptions of the items in the container to the output. Used by Get-ChildItem.

GetChildNames ( string path, ReturnContainers returnContainers ) : void

Writes the names of the children of the container to the output. Used for tab-completion.

GetItem ( string path ) : void

Writes the object describing the item to the output. Used by Get-Item.

HasChildItems ( string path ) : bool

Checks if a container actually contains items.

InitializeDefaultDrives ( ) : Collection

Creates a default Google Cloud Storage drive named gs.

IsItemContainer ( string path ) : bool

PowerShell uses this to check if an item is a container. All drives, all buckets, objects that end with "/", and prefixes to objects are containers.

IsValidPath ( string path ) : bool

Checks if a path is a legal string of characters. Shoudl pretty much always return null.

ItemExists ( string path ) : bool

PowerShell uses this to check if items exist.

NewItem ( string path, string itemTypeName, object newItemValue ) : void

Creates a new item at the given path.

NewItemDynamicParameters ( string path, string itemTypeName, object newItemValue ) : object
RemoveItem ( string path, bool recurse ) : void

Deletes a Google Cloud Storage object or bucket. Used by Remove-Item.

RemoveItemDynamicParameters ( string path, bool recurse ) : object
Stop ( ) : void

Dispose the resources used by the provider. Specifically the services.

Приватные методы

Метод Описание
DeleteObjects ( GcsPath gcsPath ) : void
GetBucketModel ( string bucket ) : BucketModel
GetChildItemBucketHelper ( Bucket bucket, bool recurse ) : void

Write out a bucket to the command line. If recurse is set to true, call GetChildItems on the bucket to process its children.

GetContentStream ( object newItemValue, NewGcsObjectDynamicParameters dynamicParameters ) : Stream
GetNewService ( ) : StorageService

This methods returns a new storage service.

ListAllProjects ( ) : IEnumerable
ListBucketsAsync ( Project project, BlockingCollection collections ) : System.Threading.Tasks.Task

Retrieves all buckets from the specified project and adding them to the blocking collection.

ListChildren ( GcsPath gcsPath, bool recurse, bool allPages = true ) : IEnumerable
NewBucket ( GcsPath gcsPath, NewGcsBucketDynamicParameters dynamicParams ) : Bucket
NewObject ( GcsPath gcsPath, NewGcsObjectDynamicParameters dynamicParameters, Stream contentStream ) : Google.Apis.Storage.v1.Data.Object
NewTelemetryReporter ( ) : IReportCmdletResults
PerformActionOnBucketAndOptionallyUpdateCache ( Action actionOnBucket ) : void

If the BucketCache is not out of date, simply perform the action on each bucket. Otherwise, we update the cache and perform the action while doing that (for example, we can write the bucket to the command line as they become available instead of writing all at once).

RemoveBucket ( GcsPath gcsPath, bool removeObjects ) : void
RemoveFolder ( GcsPath gcsPath, bool recurse ) : void
UpdateBucketCacheAndPerformActionOnBucket ( Action action ) : Bucket>.Dictionary

Update BucketCache and perform action on each of the bucket while doing so.

WaitDeleteTasks ( List deleteTasks ) : void

Waits on the list of delete tasks to compelete, updating progress as it does so.

Описание методов

ClearContent() публичный Метод

Clears the content of an object. Used by Clear-Content.
public ClearContent ( string path ) : void
path string The path of the object to clear.
Результат void

ClearContentDynamicParameters() публичный Метод

public ClearContentDynamicParameters ( string path ) : object
path string
Результат object

CopyItem() защищенный Метод

Copies a Google Cloud Storage object or folder to another object or folder. Used by Copy-Item.
protected CopyItem ( string path, string copyPath, bool recurse ) : void
path string The path to copy from.
copyPath string The path to copy to.
recurse bool If true, will copy all decendent objects as well.
Результат void

CopyItemDynamicParameters() защищенный Метод

protected CopyItemDynamicParameters ( string path, string destination, bool recurse ) : object
path string
destination string
recurse bool
Результат object

GetChildItems() защищенный Метод

Writes the object descriptions of the items in the container to the output. Used by Get-ChildItem.
protected GetChildItems ( string path, bool recurse ) : void
path string The path of the container.
recurse bool If true, get all descendents of the container, not just immediate children.
Результат void

GetChildNames() защищенный Метод

Writes the names of the children of the container to the output. Used for tab-completion.
protected GetChildNames ( string path, ReturnContainers returnContainers ) : void
path string The path to the container to get the children of.
returnContainers ReturnContainers The names of the children of the container.
Результат void

GetContentReader() публичный Метод

Gets a content reader to read the contents of a downloaded Google Cloud Storage object. Used by Get-Contents.
public GetContentReader ( string path ) : IContentReader
path string The path to the object to read.
Результат IContentReader

GetContentReaderDynamicParameters() публичный Метод

Required by IContentCmdletProvider, along with GetContentReader(string). Returns null because we have no need for dynamic parameters on Get-Content.
public GetContentReaderDynamicParameters ( string path ) : object
path string
Результат object

GetContentWriter() публичный Метод

Gets a writer used to upload data to a Google Cloud Storage object. Used by Set-Content.
public GetContentWriter ( string path ) : IContentWriter
path string The path of the object to upload to.
Результат IContentWriter

GetContentWriterDynamicParameters() публичный Метод

public GetContentWriterDynamicParameters ( string path ) : object
path string
Результат object

GetItem() защищенный Метод

Writes the object describing the item to the output. Used by Get-Item.
protected GetItem ( string path ) : void
path string The path of the item to get.
Результат void

HasChildItems() защищенный Метод

Checks if a container actually contains items.
protected HasChildItems ( string path ) : bool
path string The path to the container.
Результат bool

InitializeDefaultDrives() защищенный Метод

Creates a default Google Cloud Storage drive named gs.
protected InitializeDefaultDrives ( ) : Collection
Результат Collection

IsItemContainer() защищенный Метод

PowerShell uses this to check if an item is a container. All drives, all buckets, objects that end with "/", and prefixes to objects are containers.
protected IsItemContainer ( string path ) : bool
path string The path of the item to check.
Результат bool

IsValidPath() защищенный Метод

Checks if a path is a legal string of characters. Shoudl pretty much always return null.
protected IsValidPath ( string path ) : bool
path string The path to check.
Результат bool

ItemExists() защищенный Метод

PowerShell uses this to check if items exist.
protected ItemExists ( string path ) : bool
path string
Результат bool

NewItem() защищенный Метод

Creates a new item at the given path.
protected NewItem ( string path, string itemTypeName, object newItemValue ) : void
path string The path of the item ot create.
itemTypeName string The type of item to create. "Directory" is the only special one. /// That will create an object with a name ending in "/".
newItemValue object The value of the item to create. We assume it is a string.
Результат void

NewItemDynamicParameters() защищенный Метод

protected NewItemDynamicParameters ( string path, string itemTypeName, object newItemValue ) : object
path string
itemTypeName string
newItemValue object
Результат object

RemoveItem() защищенный Метод

Deletes a Google Cloud Storage object or bucket. Used by Remove-Item.
protected RemoveItem ( string path, bool recurse ) : void
path string The path to the object or bucket to remove.
recurse bool If true, will remove the desendants of the item as well. Required for a /// non-empty bucket.
Результат void

RemoveItemDynamicParameters() защищенный Метод

protected RemoveItemDynamicParameters ( string path, bool recurse ) : object
path string
recurse bool
Результат object

Stop() защищенный Метод

Dispose the resources used by the provider. Specifically the services.
protected Stop ( ) : void
Результат void