• NeonSDK
  • NeonKUBE
Search Results for

    Show / Hide Table of Contents
    • Neon
      • Build
    • Neon.Blazor
      • BlazorHelper
      • BodyOutlet
      • ClientRenderContext
      • DOMRectReadOnly
      • EventHandlers
      • FileDownloader
      • HtmlElement
      • IRenderContext
      • IntersectionChangedEventArgs
      • IntersectionObserver
      • IntersectionObserverContext
      • MobileDetector
      • NeonBlazorExtensions
      • ServerRenderContext
      • SwipeDirection
      • SwipeHandler
    • Neon.Blazor.Analyzers
      • SvgGenerator
      • SvgGenerator.Svg
    • Neon.BuildInfo
      • ThisAssembly
      • ThisAssembly.Git
      • ThisAssembly.Git.BaseVersion
      • ThisAssembly.Git.SemVer
    • Neon.CSharp
      • CSharpHelper
      • CompilerErrorException
      • MetadataReferences
    • Neon.Cassandra
      • KeyspaceStatus
      • RowSetExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
      • SessionExtensions
    • Neon.Collections
      • ArgDictionary
      • Bits
      • IObjectDictionary
      • NiceDictionary<TKey, TValue>
      • ObjectDictionary
    • Neon.Common
      • AppDomainExtensions
      • Block
      • BlockArray
      • ByteEncoding
      • ByteUnits
      • CommandLine
      • CommandLine.OptionDefinition
      • CommandLine.Redactor
      • CpuArchitecture
      • Credentials
      • DateTimeExtensions
      • EnumExtensions
      • EnvironmentParser
      • EnvironmentParser.Parser<T>
      • EnvironmentParser.Validator<T>
      • EnvironmentParser.VariableSource
      • ExceptionExtensions
      • ExecuteException
      • ExecuteResponse
      • GlobPattern
      • HexDumpOption
      • HttpClientExtensions
      • HttpResponseMessageExtensions
      • IEnumerableExtensions
      • ILabeled
      • IOExtensions
      • IServiceContainer
      • IStaticDirectoryExtensions
      • LabelSelector
      • LabelSelectorOptions
      • LabelSelector<TItem>
      • NeonAssemblyExtensions
      • NeonExtendedHelper
      • NeonHelper
      • NetFramework
      • NewtonsoftExtensions
      • NotReadyException
      • ProcessExtensions
      • ProgramEntrypoint
      • ProgramEntrypointAsync
      • ProgramExitException
      • ProgramRunner
      • RandomExtensions
      • ReflectionExtensions
      • SemanticVersion
      • ServiceContainer
      • StaticZipOptions
      • StringBuilderExtensions
      • StringExtensions
      • Stub
      • Stub.Value
      • TaskExtensions
      • TimeSpanExtensions
      • ToolException
      • TriState
      • WeakEventController
      • WindowsEdition
      • WindowsFeatureStatus
      • YamlDotNetExtensions
    • Neon.Cryptography
      • AesCipher
      • CryptoExtensions
      • CryptoHelper
      • NeonVault
      • Wildcard
    • Neon.Csv
      • CsvReader
      • CsvTableReader
      • CsvTableWriter
      • CsvWriter
    • Neon.Data
      • DateTimeJsonConverter
      • DateTimeOffsetJsonConverter
      • IEnhancedJsonConverter
      • IGeneratedServiceClient
      • IPersistableType
      • IPersistableType<T>
      • IRoundtripData
      • IntegerEnumConverter<TEnum>
      • NotifyPropertyChanged
      • RoundtripDataFactory
      • RoundtripDataHelper
      • TimeSpanJsonConverter
      • VersionJsonConverter
    • Neon.Deployment
      • AwsCli
      • DeploymentException
      • DeploymentHelper
      • DownloadManifest
      • DownloadPart
      • DownloadProgressDelegate
      • DownloadProgressType
      • GitHub
      • GitHubActionsApi
      • GitHubPackage
      • GitHubPackageApi
      • GitHubPackageType
      • GitHubPackageVersion
      • GitHubPackageVisibility
      • GitHubReleaseApi
      • GitHubRepoPath
      • GitHubTagApi
      • IProfileClient
      • IProfileRequest
      • IProfileResponse
      • MaintainerProfile
      • NotifyClient
      • OnePassword
      • OnePasswordException
      • ProfileException
      • ProfileHandlerResult
      • ProfileRequest
      • ProfileResponse
      • ProfileServer
      • ProfileStatus
      • XenServer
    • Neon.Deployment.CodeSigning
      • AzureProfile
      • CodeSigner
      • UsbTokenProfile
    • Neon.Diagnostics
      • AssertException
      • ConfigExtensions
      • ConsoleJsonLogExporter
      • ConsoleJsonLogExporterOptions
      • ConsoleTextLogExporter
      • ConsoleTextLogExporterOptions
      • ExceptionInfo
      • FileLogExporter
      • FileLogExporterFormat
      • FileLogExporterOptions
      • LogAsTraceProcessor
      • LogAsTraceProcessorOptions
      • LogAttributeNames
      • LogAttributes
      • LogEvent
      • LogEventInterceptor
      • LoggerExtensions
      • NullLogger
      • TelemetryHub
      • TelemetrySpanEventNames
      • TelemetrySpanExtensions
    • Neon.Docker
      • DockerClient
      • DockerNetwork
      • DockerNetworkContainer
      • DockerNetworkIpam
      • DockerNode
      • DockerNodeManagerStatus
      • DockerResponse
      • DockerSettings
      • DockerVolume
      • NetworkCreateResponse
      • ServiceBindOptions
      • ServiceConfig
      • ServiceContainerSpec
      • ServiceCredentialSpec
      • ServiceDetails
      • ServiceDiscreteResourceSpec
      • ServiceDnsConfig
      • ServiceEndpoint
      • ServiceEndpointMode
      • ServiceEndpointPortConfig
      • ServiceEndpointSpec
      • ServiceFile
      • ServiceGenericResources
      • ServiceGlobalSchedulingMode
      • ServiceHealthCheck
      • ServiceIsolationMode
      • ServiceListResponse
      • ServiceLogDriver
      • ServiceMode
      • ServiceMount
      • ServiceMountBindPropagation
      • ServiceMountConsistency
      • ServiceMountType
      • ServiceNamedResourceSpec
      • ServiceNetwork
      • ServicePlacement
      • ServicePlacementPreferences
      • ServicePlacementSpreadSettings
      • ServicePlatform
      • ServicePortMode
      • ServicePortProtocol
      • ServicePrivileges
      • ServiceReplicatedSchedulingMode
      • ServiceResourceSettings
      • ServiceResources
      • ServiceRestartCondition
      • ServiceRestartPolicy
      • ServiceRollbackConfig
      • ServiceRollbackFailureAction
      • ServiceRollbackOrder
      • ServiceSELinuxContext
      • ServiceSchedulingMode
      • ServiceSecret
      • ServiceSpec
      • ServiceTaskTemplate
      • ServiceTmpfsOptions
      • ServiceUpdateConfig
      • ServiceUpdateFailureAction
      • ServiceUpdateOrder
      • ServiceUpdateState
      • ServiceUpdateStatus
      • ServiceVersion
      • ServiceVirtualIP
      • ServiceVolumeDriverConfig
      • ServiceVolumeOptions
      • VolumeListResponse
    • Neon.GitHub
      • GitExtensions
      • GitHubCredentials
      • GitHubRepo
      • LocalRepoApi
      • NoLocalRepositoryException
      • RemoteRepoApi
      • RemoteRepoBranchApi
      • RemoteRepoIssueApi
      • RemoteRepoIssueCommentApi
      • RemoteRepoPath
      • RemoteRepoReleaseApi
      • RemoteRepoTagApi
    • Neon.HyperV
      • HyperVClient
      • HyperVDriverType
      • HyperVException
      • NetAdapter
      • VirtualDrive
      • VirtualIPAddress
      • VirtualMachine
      • VirtualMachineNetworkAdapter
      • VirtualMachineState
      • VirtualNat
      • VirtualSwitch
      • VirtualSwitchType
    • Neon.IO
      • BlockStream
      • FixedLengthStream
      • IStaticDirectory
      • IStaticFile
      • LineEnding
      • LinuxPath
      • LinuxPermissions
      • PreprocessReader
      • RelayStream
      • StaticDirectoryBase
      • StaticFileBase
      • SubStream
      • TempFile
      • TempFolder
    • Neon.JsonConverters
      • JsonDateTimeConverter
      • JsonGenericConverter<T>
      • JsonNullableDateTimeConverter
    • Neon.ModelGen
      • ActionResult<T>
      • ApiVersion
      • ApiVersionAttribute
      • BodyStreamAttribute
      • ControllerValidationAttribute
      • DataModelAttribute
      • EnumMember
      • FromBodyAttribute
      • FromHeaderAttribute
      • FromQueryAttribute
      • FromRouteAttribute
      • GeneratedClientAttribute
      • GeneratedMethodAttribute
      • GeneratedParamAttribute
      • HashSourceAttribute
      • HttpAttribute
      • HttpDeleteAttribute
      • HttpGetAttribute
      • HttpHeadAttribute
      • HttpOptionsAttribute
      • HttpPatchAttribute
      • HttpPostAttribute
      • HttpPutAttribute
      • IActionResult
      • ModelGenerator
      • ModelGeneratorOutput
      • ModelGeneratorSettings
      • NoCodeGenAttribute
      • NoControllerValidationAttribute
      • PassAs
      • PersistableAttribute
      • PersistableKeyAttribute
      • RouteAttribute
      • ServiceModelAttribute
      • TargetAttribute
      • UxFrameworks
    • Neon.Net
      • HttpApiException
      • HttpException
      • JsonClient
      • JsonClientPayload
      • JsonResponse
      • Jwt
      • LocalHostSection
      • NetConst
      • NetHelper
      • NetworkCidr
      • NetworkConfiguration
      • NetworkException
      • NetworkPorts
      • Pinger
      • ReachableHost
      • ReachableHostMode
      • StreamDocument
    • Neon.Postgres
      • ConnectionExtensions
      • DatabaseStatus
      • PreparedCommand
      • ReaderAsyncEnumerator
      • ReaderEnumerator
      • ReaderExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
    • Neon.Retry
      • ExponentialRetryPolicy
      • IRetryPolicy
      • LinearRetryPolicy
      • NoRetryPolicy
      • RetryPolicy
      • RetryPolicyBase
      • RetryTransientArgs
      • TransientDetector
      • TransientException
    • Neon.Roslyn
      • DisplayFormat
      • DocumentationComment
      • DocumentationItem
      • MetadataLoadContext
      • RoslynAssembly
      • RoslynConstructorInfo
      • RoslynCustomAttributeData
      • RoslynExtensions
      • RoslynFieldInfo
      • RoslynMethodInfo
      • RoslynParameterInfo
      • RoslynPropertyInfo
      • RoslynType
      • SharedUtilities
    • Neon.Roslyn.Xunit
      • AdditionalSourceText
      • CompilationOptions
      • CompilationOptionsProvider
      • TestCompilation
      • TestCompilationAssertions
      • TestCompilationBuilder
      • TestCompilationBuilderExtensions
      • TestCompilationExtensions
    • Neon.SSH
      • CommandBundle
      • CommandFile
      • CommandResponse
      • HostFolders
      • IBashCommandFormatter
      • ILinuxSshProxy
      • LinuxDiskInfo
      • LinuxDiskPartition
      • LinuxSshProxy
      • LinuxSshProxy<TMetadata>
      • NamespaceDoc
      • RemoteCommandException
      • RunOptions
      • SshCredentials
      • SshExtensions
      • SshProxyException
    • Neon.Service
      • LogMetricsProcessor
      • MetricsMode
      • MetricsOptions
      • NeonService
      • NeonServiceOptions
      • NeonServiceStatus
      • OtelConfigExtensions
      • OtlpCollectorChecker
      • ProcessTerminator
      • ServiceApiContact
      • ServiceApiInfo
      • ServiceApiLicense
      • ServiceDependencies
      • ServiceDescription
      • ServiceEndpoint
      • ServiceEndpointProtocol
      • ServiceEndpoints
      • ServiceMap
    • Neon.SignalR
      • DependencyInjectionExtensions
      • DnsCache
      • GroupAction
      • GroupCommand
      • IDnsCache
      • Invocation
      • NatsHubLifetimeManager<THub>
      • ProxyConfig
      • ServiceCollectionExtensions
      • ServiceDiscovey
      • SignalrProxyMiddleware
      • SignalrProxyMiddlewareExtensions
      • TracerProviderBuilderExtensions
    • Neon.Tailwind
      • ClickOffEventHandler
      • ComponentEventArgs<TSender>
      • ComponentEventArgs<TSender, TEventArgs>
      • DisclosureState
      • EventHandlerComponentBase<TComponent>
      • HeadlessButton
      • HeadlessDialog
      • HeadlessDialogPanel
      • HeadlessDisclosure
      • HeadlessDisclosureButton
      • HeadlessDisclosurePanel
      • HeadlessListboxButton<TValue>
      • HeadlessListboxLabel<TValue>
      • HeadlessListboxOption<TValue>
      • HeadlessListboxOptions<TValue>
      • HeadlessListbox<TValue>
      • HeadlessMenu
      • HeadlessMenuButton
      • HeadlessMenuItem
      • HeadlessMenuItems
      • HeadlessSwitch
      • HeadlessSwitchGroup
      • HeadlessSwitchLabel
      • IPortalBinder
      • KeyDownEventHandler
      • KeyboardKey
      • ListboxFocus
      • ListboxState
      • MenuFocus
      • MenuState
      • Portal
      • PortalBinder
      • PortalContent
      • SearchAssistant
      • TailwindExtensions
      • Transition
      • TransitionGroup
      • TransitionState
    • Neon.Tasks
      • Async
      • AsyncAutoResetEvent
      • AsyncManualResetEvent
      • AsyncMutex
      • AsyncPeriodicTask
      • AsyncReaderWriterLock
      • AsyncReentrantMutex
      • AsyncTimer
      • IAsyncFuture
      • IAsyncFuture<T>
      • NonDisposableTask
      • NonDisposableTask<T>
      • SyncContext
      • SyncContextMode
    • Neon.Temporal
      • ActivityHelper
      • ActivityLogEnricher
      • TemporalEnricherTagNames
      • WorkflowLogEnricher
    • Neon.Time
      • GatedTimer
      • GoDuration
      • PolledTimer
      • RecurringTimer
      • RecurringTimerType
      • SysTime
      • TimeOfDay
    • Neon.WSL
      • Wsl2Proxy
    • Neon.Web
      • AesProtector
      • DataProtectionExtensions
      • NeonController
      • NeonControllerBase
      • RoundTripJsonInputFormatter
      • RoundTripJsonOutputFormatter
      • TracerProviderBuilderExtensions
      • WebHelper
    • Neon.WinTTY
      • ConsoleTTY
    • Neon.Windows
      • MEMORYSTATUSEX
      • PowerShellException
      • Win32
    • Neon.XenServer
      • IXenClient
      • XenClient
      • XenClient.MachineOperations
      • XenClient.StorageOperations
      • XenClient.TemplateOperations
      • XenException
      • XenHostInfo
      • XenObject
      • XenResponse
      • XenStorageRepository
      • XenTempIso
      • XenTemplate
      • XenVirtualDisk
      • XenVirtualMachine
      • XenVmPowerState
    • Neon.Xunit
      • AnsiblePlayResults
      • AnsiblePlayer
      • AnsibleTaskResult
      • AspNetFixture
      • BasicFixture
      • CodeFixture
      • CollectionComparer<T>
      • ComposedFixture
      • ContainerFixture
      • ContainerLimits
      • DockerComposeFixture
      • DockerFixture
      • DockerFixture.ConfigInfo
      • DockerFixture.ContainerInfo
      • DockerFixture.NetworkInfo
      • DockerFixture.SecretInfo
      • DockerFixture.ServiceInfo
      • DockerFixture.StackDefinition
      • DockerFixture.StackInfo
      • DockerFixture.StackService
      • EnvironmentFixture
      • HostsFixture
      • ITestFixture
      • IncompatibleServiceException
      • MaintainerFactAttribute
      • MaintainerTheoryAttribute
      • MockHttpServer
      • MockHttpServerExtensions
      • NatsFixture
      • NatsStreamingFixture
      • NeonServiceFixture<TService>
      • PlatformFactAttribute
      • RepeatAttribute
      • TargetPlatforms
      • TestArea
      • TestCollection
      • TestContext
      • TestFixture
      • TestFixtureStatus
      • TestHelper
      • TestHttpClient
      • TestOutputWriter
      • TestTrait
      • XunitExtensions
    • Neon.Xunit.YugaByte
      • YugaByteFixture
    • Neon.YugaByte
      • YugaByteHelper

    Class AwsCli

    Wraps the AWS-CLI with methods for common operations.

    note

    The class methods require that the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables be already set with the required AWS credentials.

    Inheritance
    object
    AwsCli
    Namespace: Neon.Deployment
    Assembly: Neon.Deployment.dll
    Syntax
    public static class AwsCli

    Methods

    ExecuteSafe(params string[])

    Executes an AWS-CLI command, ensuring that it completed without error.

    Declaration
    public static void ExecuteSafe(params string[] args)
    Parameters
    Type Name Description
    string[] args

    The command and arguments.

    Exceptions
    Type Condition
    ExecuteException

    Thrown for command errors.

    RemoveCredentials()

    Removes the AWS credential environment variables.

    Declaration
    public static void RemoveCredentials()

    S3Download(string, string)

    Downloads a file from S3.

    Declaration
    public static void S3Download(string sourceUri, string targetPath)
    Parameters
    Type Name Description
    string sourceUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    string targetPath

    The target file path.

    S3DownloadBytes(string)

    Downloads a file from S3 as a byte array.

    Declaration
    public static byte[] S3DownloadBytes(string sourceUri)
    Parameters
    Type Name Description
    string sourceUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    Returns
    Type Description
    byte[]

    S3DownloadText(string, Encoding)

    Downloads a file from S3 as text.

    Declaration
    public static string S3DownloadText(string sourceUri, Encoding encoding = null)
    Parameters
    Type Name Description
    string sourceUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    Encoding encoding

    Optionally specifies the character encoding. This defaults to UTF8.

    Returns
    Type Description
    string

    S3Remove(string, bool, string, string)

    Removes one S3 objects.

    Declaration
    public static void S3Remove(string targetUri, bool recursive = false, string include = null, string exclude = null)
    Parameters
    Type Name Description
    string targetUri

    The target S3 URI or prefix for the object(s) to be removed. This may be either an s3://BUCKET[/KEY] or a https://s3.REGION.amazonaws.com/BUCKET[/KEY] URI referencing an S3 bucket and key. Note that the key is optional which means that all objects in the bucket are eligible for removal.

    bool recursive

    Optionally indicates targetUri specifies a folder prefix and that all objects within the folder are eligble for removal.

    string include

    Optionally specifies a pattern specifying the objects to be removed.

    string exclude

    Optionally specifies a pattern specifying objects to be excluded from removal.

    S3Upload(Stream, string, bool, string, bool)

    Uploads the contents of a stream to an S3 bucket.

    Declaration
    public static void S3Upload(Stream input, string targetUri, bool gzip = false, string metadata = null, bool publicReadAccess = false)
    Parameters
    Type Name Description
    Stream input

    The input stream.

    string targetUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    bool gzip

    Optionally indicates that the target content encoding should be set to gzip.

    string metadata

    Optionally specifies HTTP metadata headers to be returned when the object is downloaded from S3. This formatted as as comma separated a list of key/value pairs like:

    Content-Type=text,app-version=1.0.0
    note

    AWS supports system as well as custom headers. System headers include standard HTTP headers such as Content-Type and Content-Encoding. Custom headers are required to include the x-amz-meta- prefix.

    You don't need to specify the x-amz-meta- prefix for setting custom headers; the AWS-CLI detects custom header names and adds the prefix automatically. This method will strip the prefix if present before calling the AWS-CLI to ensure the prefix doesn't end up being duplicated.

    bool publicReadAccess

    Optionally grant the upload public read access.

    S3Upload(string, string, bool, string, bool)

    Uploads a file from the local workstation to S3.

    Declaration
    public static void S3Upload(string sourcePath, string targetUri, bool gzip = false, string metadata = null, bool publicReadAccess = false)
    Parameters
    Type Name Description
    string sourcePath

    The source file path.

    string targetUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    bool gzip

    Optionally indicates that the target content encoding should be set to gzip.

    string metadata

    Optionally specifies HTTP metadata headers to be returned when the object is downloaded from S3. This formatted as as comma separated a list of key/value pairs like:

    Content-Type=text,app-version=1.0.0
    note

    AWS supports system as well as custom headers. System headers include standard HTTP headers such as Content-Type and Content-Encoding. Custom headers are required to include the x-amz-meta- prefix.

    You don't need to specify the x-amz-meta- prefix for setting custom headers; the AWS-CLI detects custom header names and adds the prefix automatically. This method will strip the prefix if present before calling the AWS-CLI to ensure the prefix doesn't end up being duplicated.

    bool publicReadAccess

    Optionally grant the upload public read access.

    S3UploadBytes(byte[], string, bool, string, bool)

    Uploads a byte array to an S3 bucket.

    Declaration
    public static void S3UploadBytes(byte[] bytes, string targetUri, bool gzip = false, string metadata = null, bool publicReadAccess = false)
    Parameters
    Type Name Description
    byte[] bytes

    The byte array being uploaded.

    string targetUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    bool gzip

    Optionally indicates that the target content encoding should be set to gzip.

    string metadata

    Optionally specifies HTTP metadata headers to be returned when the object is downloaded from S3. This formatted as as comma separated a list of key/value pairs like:

    Content-Type=text,app-version=1.0.0
    note

    AWS supports system as well as custom headers. System headers include standard HTTP headers such as Content-Type and Content-Encoding. Custom headers are required to include the x-amz-meta- prefix.

    You don't need to specify the x-amz-meta- prefix for setting custom headers; the AWS-CLI detects custom header names and adds the prefix automatically. This method will strip the prefix if present before calling the AWS-CLI to ensure the prefix doesn't end up being duplicated.

    bool publicReadAccess

    Optionally grant the upload public read access.

    S3UploadMultiPart(string, string, string, string, string, bool, long, bool, Action<long>)

    Uploads a file in multiple parts from the local workstation to S3, returning the DownloadManifest details. required by DownloadMultiPart(DownloadManifest, string, DownloadProgressDelegate, IRetryPolicy, TimeSpan, bool) and DownloadMultiPartAsync(DownloadManifest, string, DownloadProgressDelegate, TimeSpan, IRetryPolicy, bool, CancellationToken) to actually download the entire file. The URI to the uploaded DownloadManifest details is also returned.

    See the remarks for details about how this works.

    Declaration
    public static (DownloadManifest manifest, string manifestUri) S3UploadMultiPart(string sourcePath, string targetFolderUri, string version = null, string name = null, string filename = null, bool noMd5File = false, long maxPartSize = 78643200, bool publicReadAccess = false, Action<long> progressAction = null)
    Parameters
    Type Name Description
    string sourcePath

    Path to the file being uploaded.

    string targetFolderUri

    The target S3 URI structured like https://s3.REGION.amazonaws.com/BUCKET/... URI referencing an S3 bucket and the optional folder where the file's download information and parts will be uploaded.

    note

    The s3:// URI scheme is not supported.

    string version

    Optionally specifies the download file version.

    string name

    Optionally overrides the download file name specified by sourcePath to initialize Name.

    string filename

    Optionally overrides the download file name specified by sourcePath to initialize Filename.

    bool noMd5File

    This method creates a file named [sourcePath.md5] with the MD5 hash for the entire uploaded file by default. You may override this behavior by passing noMd5File=true.

    long maxPartSize

    Optionally overrides the maximum part size (defaults to 75 MiB).

    bool publicReadAccess

    Optionally grant the upload public read access.

    Action<long> progressAction

    Optional action called as the file is uploaded, passing the long percent complete.

    Returns
    Type Description
    (DownloadManifest manifest, string manifestUri)

    The DownloadManifest information as well as the URI to the uploaded manifest.

    Remarks

    This method works by splitting the sourcePath file into parts no larger than maxPartSize bytes each and the uploading these parts to the specified bucket and path along with a file holding DownloadManifest information describing the download and its constituent parts. This information includes details about the download including the overall MD5 and size as well records describing each part including their URIs, sizes and MD5.

    The DownloadManifest details returned include all of the information required by DownloadMultiPart(DownloadManifest, string, DownloadProgressDelegate, IRetryPolicy, TimeSpan, bool) and DownloadMultiPartAsync(DownloadManifest, string, DownloadProgressDelegate, TimeSpan, IRetryPolicy, bool, CancellationToken) to actually download the entire file and the URI returned references these msame details as uploaded to S3.

    You'll need to pass sourcePath as the path to the file being uploaded and targetFolderUri as the S3 location where the download information and the file parts will be uploaded. targetFolderUri may use with the https:// or s3:// URI scheme.

    By default the uploaded file and parts names will be based on the filename part of sourcePath, but this can be overridden via filename. The DownloadManifest information for the file will be uploaded as FILENAME.manifest and the parts will be written to a subfolder named FILENAME.parts. For example, uploading a large file named myfile.json to https://s3.uswest.amazonaws.com/mybucket will result S3 file layout like:

    https://s3.uswest.amazonaws.com/mybucket
        myfile.json.manifest
        myfile.json.parts/
            part-0000
            part-0001
            part-0002
            ...

    The URI returned in this case will be https://s3.uswest.amazonaws.com/mybucket/myfile.json.manifest.

    note

    This method uses two threads for uploading the parts because it seems to take the AWS CLI tool several seconds to actually start the upload, resulting in a lot of wasted uploading time.

    S3UploadText(string, string, bool, string, bool, Encoding)

    Uploads text to an S3 bucket.

    Declaration
    public static void S3UploadText(string text, string targetUri, bool gzip = false, string metadata = null, bool publicReadAccess = false, Encoding encoding = null)
    Parameters
    Type Name Description
    string text

    The text being uploaded.

    string targetUri

    The target S3 URI. This may be either an s3://BUCKET/KEY or a https://s3.REGION.amazonaws.com/BUCKET/KEY URI referencing an S3 bucket and key.

    bool gzip

    Optionally indicates that the target content encoding should be set to gzip.

    string metadata

    Optionally specifies HTTP metadata headers to be returned when the object is downloaded from S3. This formatted as as comma separated a list of key/value pairs like:

    Content-Type=text,app-version=1.0.0
    note

    AWS supports system as well as custom headers. System headers include standard HTTP headers such as Content-Type and Content-Encoding. Custom headers are required to include the x-amz-meta- prefix.

    You don't need to specify the x-amz-meta- prefix for setting custom headers; the AWS-CLI detects custom header names and adds the prefix automatically. This method will strip the prefix if present before calling the AWS-CLI to ensure the prefix doesn't end up being duplicated.

    bool publicReadAccess

    Optionally grant the upload public read access.

    Encoding encoding

    Optionally specifies the text encoding. This defaults to UTF8.

    SetCredentials(string, string, string, string)

    Sets the AWS credential environment variables by loading them from 1Password.

    Declaration
    public static void SetCredentials(string awsAccessKeyId = "AWS_NEONFORGE[ACCESS_KEY_ID]", string awsSecretAccessKey = "AWS_NEONFORGE[SECRET_ACCESS_KEY]", string vault = null, string masterPassword = null)
    Parameters
    Type Name Description
    string awsAccessKeyId

    Optionally overrides the AWS access key ID 1Password secret name.

    string awsSecretAccessKey

    Optionally overrides the AWS access key 1Password secret name.

    string vault

    Optionally overrides the current user's 1Password vault.

    string masterPassword

    Optionally specifies the master 1Password.

    In this article
    Back to top © Copyright 2005-2023 by NEONFORGE LLC