C# Class Google.PowerShell.CloudStorage.GoogleCloudStorageProvider

Inheritance: System.Management.Automation.Provider.NavigationCmdletProvider, IContentCmdletProvider
Afficher le fichier Open project: GoogleCloudPlatform/google-cloud-powershell

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

ClearContent() public méthode

Clears the content of an object. Used by Clear-Content.
public ClearContent ( string path ) : void
path string The path of the object to clear.
Résultat void

ClearContentDynamicParameters() public méthode

public ClearContentDynamicParameters ( string path ) : object
path string
Résultat object

CopyItem() protected méthode

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.
Résultat void

CopyItemDynamicParameters() protected méthode

protected CopyItemDynamicParameters ( string path, string destination, bool recurse ) : object
path string
destination string
recurse bool
Résultat object

GetChildItems() protected méthode

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.
Résultat void

GetChildNames() protected méthode

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.
Résultat void

GetContentReader() public méthode

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.
Résultat IContentReader

GetContentReaderDynamicParameters() public méthode

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
Résultat object

GetContentWriter() public méthode

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.
Résultat IContentWriter

GetContentWriterDynamicParameters() public méthode

public GetContentWriterDynamicParameters ( string path ) : object
path string
Résultat object

GetItem() protected méthode

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.
Résultat void

HasChildItems() protected méthode

Checks if a container actually contains items.
protected HasChildItems ( string path ) : bool
path string The path to the container.
Résultat bool

InitializeDefaultDrives() protected méthode

Creates a default Google Cloud Storage drive named gs.
protected InitializeDefaultDrives ( ) : Collection
Résultat Collection

IsItemContainer() protected méthode

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.
Résultat bool

IsValidPath() protected méthode

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.
Résultat bool

ItemExists() protected méthode

PowerShell uses this to check if items exist.
protected ItemExists ( string path ) : bool
path string
Résultat bool

NewItem() protected méthode

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.
Résultat void

NewItemDynamicParameters() protected méthode

protected NewItemDynamicParameters ( string path, string itemTypeName, object newItemValue ) : object
path string
itemTypeName string
newItemValue object
Résultat object

RemoveItem() protected méthode

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.
Résultat void

RemoveItemDynamicParameters() protected méthode

protected RemoveItemDynamicParameters ( string path, bool recurse ) : object
path string
recurse bool
Résultat object

Stop() protected méthode

Dispose the resources used by the provider. Specifically the services.
protected Stop ( ) : void
Résultat void