build(deps): bump github.com/Azure/azure-storage-blob-go

Bumps [github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/Azure/azure-storage-blob-go/releases)
- [Changelog](https://github.com/Azure/azure-storage-blob-go/blob/master/ChangeLog.md)
- [Commits](https://github.com/Azure/azure-storage-blob-go/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-storage-blob-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-09-04 13:54:38 +00:00 committed by Ondřej Budai
parent cad77a25d1
commit aab7bff174
23 changed files with 943 additions and 352 deletions

2
go.mod
View file

@ -7,7 +7,7 @@ require (
cloud.google.com/go/storage v1.10.0
github.com/Azure/azure-pipeline-go v0.2.3
github.com/Azure/azure-sdk-for-go v41.3.0+incompatible
github.com/Azure/azure-storage-blob-go v0.13.0
github.com/Azure/azure-storage-blob-go v0.14.0
github.com/Azure/go-autorest/autorest v0.11.20
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect

14
go.sum
View file

@ -39,8 +39,8 @@ github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVt
github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k=
github.com/Azure/azure-sdk-for-go v41.3.0+incompatible h1:W5px0x53aa47nmIAuF1XWR1ZzFuUnkJBGUuzHnNp+Nk=
github.com/Azure/azure-sdk-for-go v41.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-storage-blob-go v0.13.0 h1:lgWHvFh+UYBNVQLFHXkvul2f6yOPA9PIH82RTG2cSwc=
github.com/Azure/azure-storage-blob-go v0.13.0/go.mod h1:pA9kNqtjUeQF2zOSu4s//nUdBD+e64lEuc4sVnuOfNs=
github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM=
github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
@ -50,7 +50,6 @@ github.com/Azure/go-autorest/autorest v0.11.20/go.mod h1:o3tqFY+QR40VOlk+pV4d77m
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE=
github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q=
github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=
@ -413,8 +412,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
@ -483,8 +483,6 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
@ -996,8 +994,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=

View file

@ -56,6 +56,7 @@ func copyFromReader(ctx context.Context, from io.Reader, to blockWriter, o Uploa
}
// If the error is not EOF, then we have a problem.
if err != nil && !errors.Is(err, io.EOF) {
cp.wg.Wait()
return nil, err
}

View file

@ -139,22 +139,22 @@ func (b BlobURL) Delete(ctx context.Context, deleteOptions DeleteSnapshotsOption
return b.blobClient.Delete(ctx, nil, nil, nil, ac.LeaseAccessConditions.pointers(), deleteOptions,
ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag,
nil, // Blob ifTags
nil)
nil, BlobDeleteNone)
}
// SetTags operation enables users to set tags on a blob or specific blob version, but not snapshot.
// Each call to this operation replaces all existing tags attached to the blob.
// To remove all tags from the blob, call this operation with no tags set.
// https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tags
func (b BlobURL) SetTags(ctx context.Context, timeout *int32, versionID *string, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, requestID *string, ifTags *string, blobTagsMap BlobTagsMap) (*BlobSetTagsResponse, error) {
func (b BlobURL) SetTags(ctx context.Context, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, ifTags *string, blobTagsMap BlobTagsMap) (*BlobSetTagsResponse, error) {
tags := SerializeBlobTags(blobTagsMap)
return b.blobClient.SetTags(ctx, timeout, versionID, transactionalContentMD5, transactionalContentCrc64, requestID, ifTags, &tags)
return b.blobClient.SetTags(ctx, nil, nil, transactionalContentMD5, transactionalContentCrc64, nil, ifTags, nil, &tags)
}
// GetTags operation enables users to get tags on a blob or specific blob version, or snapshot.
// https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-tags
func (b BlobURL) GetTags(ctx context.Context, timeout *int32, requestID *string, snapshot *string, versionID *string, ifTags *string) (*BlobTags, error) {
return b.blobClient.GetTags(ctx, timeout, requestID, snapshot, versionID, ifTags)
func (b BlobURL) GetTags(ctx context.Context, ifTags *string) (*BlobTags, error) {
return b.blobClient.GetTags(ctx, nil, nil, nil, nil, ifTags, nil)
}
// Undelete restores the contents and metadata of a soft-deleted blob and any associated soft-deleted snapshots.
@ -173,7 +173,8 @@ func (b BlobURL) Undelete(ctx context.Context) (*BlobUndeleteResponse, error) {
func (b BlobURL) SetTier(ctx context.Context, tier AccessTierType, lac LeaseAccessConditions) (*BlobSetTierResponse, error) {
return b.blobClient.SetTier(ctx, tier, nil,
nil, // Blob versioning
nil, RehydratePriorityNone, nil, lac.pointers())
nil, RehydratePriorityNone, nil, lac.pointers(),
nil) // Blob ifTags
}
// GetProperties returns the blob's properties.

View file

@ -154,6 +154,22 @@ func (bb BlockBlobURL) CopyFromURL(ctx context.Context, source url.URL, metadata
nil, // Blob ifTags
dstLeaseID, nil, srcContentMD5,
blobTagsString, // Blob tags
nil, // seal Blob
)
}
// PutBlobFromURL synchronously creates a new Block Blob with data from the source URL up to a max length of 256MB.
// For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob-from-url.
func (bb BlockBlobURL) PutBlobFromURL(ctx context.Context, h BlobHTTPHeaders, source url.URL, metadata Metadata, srcac ModifiedAccessConditions, dstac BlobAccessConditions, srcContentMD5 []byte, dstContentMD5 []byte, tier AccessTierType, blobTagsMap BlobTagsMap, cpk ClientProvidedKeyOptions) (*BlockBlobPutBlobFromURLResponse, error) {
srcIfModifiedSince, srcIfUnmodifiedSince, srcIfMatchETag, srcIfNoneMatchETag := srcac.pointers()
dstIfModifiedSince, dstIfUnmodifiedSince, dstIfMatchETag, dstIfNoneMatchETag := dstac.ModifiedAccessConditions.pointers()
dstLeaseID := dstac.LeaseAccessConditions.pointers()
blobTagsString := SerializeBlobTagsHeader(blobTagsMap)
return bb.bbClient.PutBlobFromURL(ctx, 0, source.String(), nil, nil,
&h.ContentType, &h.ContentEncoding, &h.ContentLanguage, dstContentMD5, &h.CacheControl,
metadata, dstLeaseID, &h.ContentDisposition, cpk.EncryptionKey, cpk.EncryptionKeySha256,
cpk.EncryptionAlgorithm, cpk.EncryptionScope, tier, dstIfModifiedSince, dstIfUnmodifiedSince,
dstIfMatchETag, dstIfNoneMatchETag, nil, srcIfModifiedSince, srcIfUnmodifiedSince,
srcIfMatchETag, srcIfNoneMatchETag, nil, nil, srcContentMD5, blobTagsString, nil)
}

View file

@ -126,7 +126,7 @@ func (pb PageBlobURL) ClearPages(ctx context.Context, offset int64, count int64,
cpk.EncryptionKey, cpk.EncryptionKeySha256, cpk.EncryptionAlgorithm, // CPK
cpk.EncryptionScope, // CPK-N
ifSequenceNumberLessThanOrEqual, ifSequenceNumberLessThan,
ifSequenceNumberEqual, ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil)
ifSequenceNumberEqual, ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil, nil)
}
// GetPageRanges returns the list of valid page ranges for a page blob or snapshot of a page blob.
@ -175,7 +175,7 @@ func (pb PageBlobURL) Resize(ctx context.Context, size int64, ac BlobAccessCondi
return pb.pbClient.Resize(ctx, size, nil, ac.LeaseAccessConditions.pointers(),
cpk.EncryptionKey, cpk.EncryptionKeySha256, cpk.EncryptionAlgorithm, // CPK
cpk.EncryptionScope, // CPK-N
ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil)
ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil, nil)
}
// UpdateSequenceNumber sets the page blob's sequence number.
@ -188,7 +188,7 @@ func (pb PageBlobURL) UpdateSequenceNumber(ctx context.Context, action SequenceN
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch := ac.ModifiedAccessConditions.pointers()
return pb.pbClient.UpdateSequenceNumber(ctx, action, nil,
ac.LeaseAccessConditions.pointers(), ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch,
sn, nil)
nil, sn, nil)
}
// StartCopyIncremental begins an operation to start an incremental copy from one page blob's snapshot to this page blob.
@ -202,7 +202,7 @@ func (pb PageBlobURL) StartCopyIncremental(ctx context.Context, source url.URL,
qp.Set("snapshot", snapshot)
source.RawQuery = qp.Encode()
return pb.pbClient.CopyIncremental(ctx, source.String(), nil,
ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil)
ifModifiedSince, ifUnmodifiedSince, ifMatchETag, ifNoneMatchETag, nil, nil)
}
func (pr PageRange) pointers() *string {

View file

@ -1,3 +1,3 @@
package azblob
const serviceLibVersion = "0.13"
const serviceLibVersion = "0.14"

View file

@ -18,6 +18,11 @@ type RequestLogOptions struct {
// LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified
// duration (-1=no logging; 0=default threshold).
LogWarningIfTryOverThreshold time.Duration
// SyslogDisabled is a flag to check if logging to Syslog/Windows-Event-Logger is enabled or not
// We by default print to Syslog/Windows-Event-Logger.
// If SyslogDisabled is not provided explicitly, the default value will be false.
SyslogDisabled bool
}
func (o RequestLogOptions) defaults() RequestLogOptions {
@ -59,7 +64,7 @@ func NewRequestLogPolicyFactory(o RequestLogOptions) pipeline.Factory {
// If the response took too long, we'll upgrade to warning.
if o.LogWarningIfTryOverThreshold > 0 && tryDuration > o.LogWarningIfTryOverThreshold {
// Log a warning if the try duration exceeded the specified threshold
logLevel, forceLog = pipeline.LogWarning, true
logLevel, forceLog = pipeline.LogWarning, !o.SyslogDisabled
}
var sc int
@ -73,8 +78,9 @@ func NewRequestLogPolicyFactory(o RequestLogOptions) pipeline.Factory {
}
}
if sc == 0 || ((sc >= 400 && sc <= 499) && sc != http.StatusNotFound && sc != http.StatusConflict && sc != http.StatusPreconditionFailed && sc != http.StatusRequestedRangeNotSatisfiable) || (sc >= 500 && sc <= 599) {
logLevel, forceLog = pipeline.LogError, true // Promote to Error any 4xx (except those listed is an error) or any 5xx
if sc == 0 || ((sc >= 400 && sc <= 499) && sc != http.StatusNotFound && sc != http.StatusConflict &&
sc != http.StatusPreconditionFailed && sc != http.StatusRequestedRangeNotSatisfiable) || (sc >= 500 && sc <= 599) {
logLevel, forceLog = pipeline.LogError, !o.SyslogDisabled // Promote to Error any 4xx (except those listed is an error) or any 5xx
} else {
// For other status codes, we leave the level as is.
}

View file

@ -3,6 +3,7 @@ package azblob
import (
"context"
"errors"
"github.com/Azure/azure-pipeline-go/pipeline"
)
@ -21,11 +22,9 @@ func NewUniqueRequestIDPolicyFactory() pipeline.Factory {
resp, err := next.Do(ctx, request)
if err == nil && resp != nil {
val := resp.Response().Header.Values(xMsClientRequestID)
if len(val) > 0 {
if val[0] != id {
err = errors.New("client Request ID from request and response does not match")
}
crId := resp.Response().Header.Get(xMsClientRequestID)
if crId != "" && crId != id {
err = errors.New("client Request ID from request and response does not match")
}
}

View file

@ -366,16 +366,15 @@ func (client blobClient) changeLeaseResponder(resp pipeline.Response) (pipeline.
// only succeeds if the resource's lease is active and matches this ID. requestID is provides a client-generated,
// opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is
// enabled. sourceContentMD5 is specify the md5 calculated for the range of bytes that must be read from the copy
// source. blobTagsString is optional. Used to set blob tags in various blob operations. sealBlob is overrides the
// sealed state of the destination blob. Service version 2019-12-12 and newer.
func (client blobClient) CopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, sealBlob *bool) (*BlobCopyFromURLResponse, error) {
// source. blobTagsString is optional. Used to set blob tags in various blob operations.
func (client blobClient) CopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string) (*BlobCopyFromURLResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.copyFromURLPreparer(copySource, timeout, metadata, tier, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, sourceContentMD5, blobTagsString, sealBlob)
req, err := client.copyFromURLPreparer(copySource, timeout, metadata, tier, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, sourceContentMD5, blobTagsString)
if err != nil {
return nil, err
}
@ -387,7 +386,7 @@ func (client blobClient) CopyFromURL(ctx context.Context, copySource string, tim
}
// copyFromURLPreparer prepares the CopyFromURL request.
func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, sealBlob *bool) (pipeline.Request, error) {
func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -446,9 +445,6 @@ func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32,
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if sealBlob != nil {
req.Header.Set("x-ms-seal-blob", strconv.FormatBool(*sealBlob))
}
req.Header.Set("x-ms-requires-sync", "true")
return req, nil
}
@ -599,15 +595,16 @@ func (client blobClient) createSnapshotResponder(resp pipeline.Response) (pipeli
// blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
// ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching value. requestID is
// provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when
// storage analytics logging is enabled.
func (client blobClient) Delete(ctx context.Context, snapshot *string, versionID *string, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (*BlobDeleteResponse, error) {
// storage analytics logging is enabled. blobDeleteType is optional. Only possible value is 'permanent', which
// specifies to permanently delete a blob if blob soft delete is enabled.
func (client blobClient) Delete(ctx context.Context, snapshot *string, versionID *string, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobDeleteType BlobDeleteType) (*BlobDeleteResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.deletePreparer(snapshot, versionID, timeout, leaseID, deleteSnapshots, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID)
req, err := client.deletePreparer(snapshot, versionID, timeout, leaseID, deleteSnapshots, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobDeleteType)
if err != nil {
return nil, err
}
@ -619,7 +616,7 @@ func (client blobClient) Delete(ctx context.Context, snapshot *string, versionID
}
// deletePreparer prepares the Delete request.
func (client blobClient) deletePreparer(snapshot *string, versionID *string, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (pipeline.Request, error) {
func (client blobClient) deletePreparer(snapshot *string, versionID *string, timeout *int32, leaseID *string, deleteSnapshots DeleteSnapshotsOptionType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobDeleteType BlobDeleteType) (pipeline.Request, error) {
req, err := pipeline.NewRequest("DELETE", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -634,6 +631,9 @@ func (client blobClient) deletePreparer(snapshot *string, versionID *string, tim
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
if blobDeleteType != BlobDeleteNone {
params.Set("deletetype", string(blobDeleteType))
}
req.URL.RawQuery = params.Encode()
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
@ -1020,15 +1020,16 @@ func (client blobClient) getPropertiesResponder(resp pipeline.Response) (pipelin
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
// a Snapshot of a Blob.</a> versionID is the version id parameter is an opaque DateTime value that, when present,
// specifies the version of the blob to operate on. It's for service version 2019-10-10 and newer. ifTags is specify a
// SQL where clause on blob tags to operate only on blobs with a matching value.
func (client blobClient) GetTags(ctx context.Context, timeout *int32, requestID *string, snapshot *string, versionID *string, ifTags *string) (*BlobTags, error) {
// SQL where clause on blob tags to operate only on blobs with a matching value. leaseID is if specified, the operation
// only succeeds if the resource's lease is active and matches this ID.
func (client blobClient) GetTags(ctx context.Context, timeout *int32, requestID *string, snapshot *string, versionID *string, ifTags *string, leaseID *string) (*BlobTags, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.getTagsPreparer(timeout, requestID, snapshot, versionID, ifTags)
req, err := client.getTagsPreparer(timeout, requestID, snapshot, versionID, ifTags, leaseID)
if err != nil {
return nil, err
}
@ -1040,7 +1041,7 @@ func (client blobClient) GetTags(ctx context.Context, timeout *int32, requestID
}
// getTagsPreparer prepares the GetTags request.
func (client blobClient) getTagsPreparer(timeout *int32, requestID *string, snapshot *string, versionID *string, ifTags *string) (pipeline.Request, error) {
func (client blobClient) getTagsPreparer(timeout *int32, requestID *string, snapshot *string, versionID *string, ifTags *string, leaseID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("GET", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -1064,6 +1065,9 @@ func (client blobClient) getTagsPreparer(timeout *int32, requestID *string, snap
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
return req, nil
}
@ -1092,107 +1096,111 @@ func (client blobClient) getTagsResponder(resp pipeline.Response) (pipeline.Resp
return result, nil
}
// TODO funky quick query code
//// Query the Query operation enables users to select/project on blob data by providing simple query expressions.
////
//// snapshot is the snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to
//// retrieve. For more information on working with blob snapshots, see <a
//// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
//// a Snapshot of a Blob.</a> timeout is the timeout parameter is expressed in seconds. For more information, see <a
//// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
//// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the resource's
//// lease is active and matches this ID. encryptionKey is optional. Specifies the encryption key to use to encrypt the
//// data provided in the request. If not specified, encryption is performed with the root account encryption key. For
//// more information, see Encryption at Rest for Azure Storage Services. encryptionKeySha256 is the SHA-256 hash of the
//// provided encryption key. Must be provided if the x-ms-encryption-key header is provided. encryptionAlgorithm is the
//// algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided
//// if the x-ms-encryption-key header is provided. ifModifiedSince is specify this header value to operate only on a
//// blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
//// operate only on a blob if it has not been modified since the specified date/time. ifMatch is specify an ETag value
//// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
//// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
//// recorded in the analytics logs when storage analytics logging is enabled.
//func (client blobClient) Query(ctx context.Context, snapshot *string, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*QueryResponse, error) {
// if err := validate([]validation{
// {targetValue: timeout,
// constraints: []constraint{{target: "timeout", name: null, rule: false,
// chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
// return nil, err
// }
// req, err := client.queryPreparer(snapshot, timeout, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
// if err != nil {
// return nil, err
// }
// resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.queryResponder}, req)
// if err != nil {
// return nil, err
// }
// return resp.(*QueryResponse), err
//}
// todo funky quick query code
// // Query the Query operation enables users to select/project on blob data by providing simple query expressions.
// //
// // snapshot is the snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to
// // retrieve. For more information on working with blob snapshots, see <a
// // href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
// // a Snapshot of a Blob.</a> timeout is the timeout parameter is expressed in seconds. For more information, see <a
// // href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// // Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the resource's
// // lease is active and matches this ID. encryptionKey is optional. Specifies the encryption key to use to encrypt the
// // data provided in the request. If not specified, encryption is performed with the root account encryption key. For
// // more information, see Encryption at Rest for Azure Storage Services. encryptionKeySha256 is the SHA-256 hash of the
// // provided encryption key. Must be provided if the x-ms-encryption-key header is provided. encryptionAlgorithm is the
// // algorithm used to produce the encryption key hash. Currently, the only accepted value is "AES256". Must be provided
// // if the x-ms-encryption-key header is provided. ifModifiedSince is specify this header value to operate only on a
// // blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
// // operate only on a blob if it has not been modified since the specified date/time. ifMatch is specify an ETag value
// // to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
// // without a matching value. ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching
// // value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
// // analytics logs when storage analytics logging is enabled.
// func (client blobClient) Query(ctx context.Context, snapshot *string, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (*QueryResponse, error) {
// if err := validate([]validation{
// {targetValue: timeout,
// constraints: []constraint{{target: "timeout", name: null, rule: false,
// chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
// return nil, err
// }
// req, err := client.queryPreparer(snapshot, timeout, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID)
// if err != nil {
// return nil, err
// }
// resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.queryResponder}, req)
// if err != nil {
// return nil, err
// }
// return resp.(*QueryResponse), err
// }
//
//// queryPreparer prepares the Query request.
//func (client blobClient) queryPreparer(snapshot *string, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
// req, err := pipeline.NewRequest("POST", client.url, nil)
// if err != nil {
// return req, pipeline.NewError(err, "failed to create request")
// }
// params := req.URL.Query()
// if snapshot != nil && len(*snapshot) > 0 {
// params.Set("snapshot", *snapshot)
// }
// if timeout != nil {
// params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
// }
// params.Set("comp", "query")
// req.URL.RawQuery = params.Encode()
// if leaseID != nil {
// req.Header.Set("x-ms-lease-id", *leaseID)
// }
// if encryptionKey != nil {
// req.Header.Set("x-ms-encryption-key", *encryptionKey)
// }
// if encryptionKeySha256 != nil {
// req.Header.Set("x-ms-encryption-key-sha256", *encryptionKeySha256)
// }
// if encryptionAlgorithm != EncryptionAlgorithmNone {
// req.Header.Set("x-ms-encryption-algorithm", string(encryptionAlgorithm))
// }
// if ifModifiedSince != nil {
// req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifUnmodifiedSince != nil {
// req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifMatch != nil {
// req.Header.Set("If-Match", string(*ifMatch))
// }
// if ifNoneMatch != nil {
// req.Header.Set("If-None-Match", string(*ifNoneMatch))
// }
// req.Header.Set("x-ms-version", ServiceVersion)
// if requestID != nil {
// req.Header.Set("x-ms-client-request-id", *requestID)
// }
// b, err := xml.Marshal(queryRequest)
// if err != nil {
// return req, pipeline.NewError(err, "failed to marshal request body")
// }
// req.Header.Set("Content-Type", "application/xml")
// err = req.SetBody(bytes.NewReader(b))
// if err != nil {
// return req, pipeline.NewError(err, "failed to set request body")
// }
// return req, nil
//}
// // queryPreparer prepares the Query request.
// func (client blobClient) queryPreparer(snapshot *string, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (pipeline.Request, error) {
// req, err := pipeline.NewRequest("POST", client.url, nil)
// if err != nil {
// return req, pipeline.NewError(err, "failed to create request")
// }
// params := req.URL.Query()
// if snapshot != nil && len(*snapshot) > 0 {
// params.Set("snapshot", *snapshot)
// }
// if timeout != nil {
// params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
// }
// params.Set("comp", "query")
// req.URL.RawQuery = params.Encode()
// if leaseID != nil {
// req.Header.Set("x-ms-lease-id", *leaseID)
// }
// if encryptionKey != nil {
// req.Header.Set("x-ms-encryption-key", *encryptionKey)
// }
// if encryptionKeySha256 != nil {
// req.Header.Set("x-ms-encryption-key-sha256", *encryptionKeySha256)
// }
// if encryptionAlgorithm != EncryptionAlgorithmNone {
// req.Header.Set("x-ms-encryption-algorithm", string(encryptionAlgorithm))
// }
// if ifModifiedSince != nil {
// req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifUnmodifiedSince != nil {
// req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifMatch != nil {
// req.Header.Set("If-Match", string(*ifMatch))
// }
// if ifNoneMatch != nil {
// req.Header.Set("If-None-Match", string(*ifNoneMatch))
// }
// if ifTags != nil {
// req.Header.Set("x-ms-if-tags", *ifTags)
// }
// req.Header.Set("x-ms-version", ServiceVersion)
// if requestID != nil {
// req.Header.Set("x-ms-client-request-id", *requestID)
// }
// b, err := xml.Marshal(queryRequest)
// if err != nil {
// return req, pipeline.NewError(err, "failed to marshal request body")
// }
// req.Header.Set("Content-Type", "application/xml")
// err = req.SetBody(bytes.NewReader(b))
// if err != nil {
// return req, pipeline.NewError(err, "failed to set request body")
// }
// return req, nil
// }
//
//// queryResponder handles the response to the Query request.
//func (client blobClient) queryResponder(resp pipeline.Response) (pipeline.Response, error) {
// err := validateResponse(resp, http.StatusOK, http.StatusPartialContent)
// if resp == nil {
// return nil, err
// }
// return &QueryResponse{rawResponse: resp.Response()}, err
//}
// // queryResponder handles the response to the Query request.
// func (client blobClient) queryResponder(resp pipeline.Response) (pipeline.Response, error) {
// err := validateResponse(resp, http.StatusOK, http.StatusPartialContent)
// if resp == nil {
// return nil, err
// }
// return &QueryResponse{rawResponse: resp.Response()}, err
// }
// ReleaseLease [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
// operations
@ -1272,146 +1280,145 @@ func (client blobClient) releaseLeaseResponder(resp pipeline.Response) (pipeline
return &BlobReleaseLeaseResponse{rawResponse: resp.Response()}, err
}
// TODO funky rename API
//// Rename rename a blob/file. By default, the destination is overwritten and if the destination already exists and has
//// a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see
//// [Specifying Conditional Headers for Blob Service
//// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
//// To fail if the destination already exists, use a conditional request with If-None-Match: "*".
////
//// renameSource is the file or directory to be renamed. The value must have the following format:
//// "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties;
//// otherwise, the existing properties will be preserved. timeout is the timeout parameter is expressed in seconds. For
//// more information, see <a
//// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
//// Timeouts for Blob Service Operations.</a> directoryProperties is optional. User-defined properties to be stored
//// with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...",
//// where each value is base64 encoded. posixPermissions is optional and only valid if Hierarchical Namespace is enabled
//// for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may
//// be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and
//// 4-digit octal notation (e.g. 0766) are supported. posixUmask is only valid if Hierarchical Namespace is enabled for
//// the account. This umask restricts permission settings for file and directory, and will only be applied when default
//// Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be
//// disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation
//// (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. cacheControl is cache
//// control for given resource contentType is content type for given resource contentEncoding is content encoding for
//// given resource contentLanguage is content language for given resource contentDisposition is content disposition for
//// given resource leaseID is if specified, the operation only succeeds if the resource's lease is active and matches
//// this ID. sourceLeaseID is a lease ID for the source path. If specified, the source path must have an active lease
//// and the lease ID must match. ifModifiedSince is specify this header value to operate only on a blob if it has been
//// modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if
//// it has not been modified since the specified date/time. ifMatch is specify an ETag value to operate only on blobs
//// with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
//// sourceIfModifiedSince is specify this header value to operate only on a blob if it has been modified since the
//// specified date/time. sourceIfUnmodifiedSince is specify this header value to operate only on a blob if it has not
//// been modified since the specified date/time. sourceIfMatch is specify an ETag value to operate only on blobs with a
//// matching value. sourceIfNoneMatch is specify an ETag value to operate only on blobs without a matching value.
//// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
//// logs when storage analytics logging is enabled.
//func (client blobClient) Rename(ctx context.Context, renameSource string, timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (*BlobRenameResponse, error) {
// if err := validate([]validation{
// {targetValue: timeout,
// constraints: []constraint{{target: "timeout", name: null, rule: false,
// chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
// return nil, err
// }
// req, err := client.renamePreparer(renameSource, timeout, directoryProperties, posixPermissions, posixUmask, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseID, sourceLeaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestID)
// if err != nil {
// return nil, err
// }
// resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.renameResponder}, req)
// if err != nil {
// return nil, err
// }
// return resp.(*BlobRenameResponse), err
//}
// Rename rename a blob/file. By default, the destination is overwritten and if the destination already exists and has
// a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see
// [Specifying Conditional Headers for Blob Service
// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
// To fail if the destination already exists, use a conditional request with If-None-Match: "*".
//
//// renamePreparer prepares the Rename request.
//func (client blobClient) renamePreparer(renameSource string, timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
// req, err := pipeline.NewRequest("PUT", client.url, nil)
// if err != nil {
// return req, pipeline.NewError(err, "failed to create request")
// }
// params := req.URL.Query()
// if timeout != nil {
// params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
// }
// if pathRenameMode != PathRenameModeNone {
// params.Set("mode", string(client.PathRenameMode))
// }
// req.URL.RawQuery = params.Encode()
// req.Header.Set("x-ms-rename-source", renameSource)
// if directoryProperties != nil {
// req.Header.Set("x-ms-properties", *directoryProperties)
// }
// if posixPermissions != nil {
// req.Header.Set("x-ms-permissions", *posixPermissions)
// }
// if posixUmask != nil {
// req.Header.Set("x-ms-umask", *posixUmask)
// }
// if cacheControl != nil {
// req.Header.Set("x-ms-cache-control", *cacheControl)
// }
// if contentType != nil {
// req.Header.Set("x-ms-content-type", *contentType)
// }
// if contentEncoding != nil {
// req.Header.Set("x-ms-content-encoding", *contentEncoding)
// }
// if contentLanguage != nil {
// req.Header.Set("x-ms-content-language", *contentLanguage)
// }
// if contentDisposition != nil {
// req.Header.Set("x-ms-content-disposition", *contentDisposition)
// }
// if leaseID != nil {
// req.Header.Set("x-ms-lease-id", *leaseID)
// }
// if sourceLeaseID != nil {
// req.Header.Set("x-ms-source-lease-id", *sourceLeaseID)
// }
// if ifModifiedSince != nil {
// req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifUnmodifiedSince != nil {
// req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
// }
// if ifMatch != nil {
// req.Header.Set("If-Match", string(*ifMatch))
// }
// if ifNoneMatch != nil {
// req.Header.Set("If-None-Match", string(*ifNoneMatch))
// }
// if sourceIfModifiedSince != nil {
// req.Header.Set("x-ms-source-if-modified-since", (*sourceIfModifiedSince).In(gmt).Format(time.RFC1123))
// }
// if sourceIfUnmodifiedSince != nil {
// req.Header.Set("x-ms-source-if-unmodified-since", (*sourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123))
// }
// if sourceIfMatch != nil {
// req.Header.Set("x-ms-source-if-match", string(*sourceIfMatch))
// }
// if sourceIfNoneMatch != nil {
// req.Header.Set("x-ms-source-if-none-match", string(*sourceIfNoneMatch))
// }
// req.Header.Set("x-ms-version", ServiceVersion)
// if requestID != nil {
// req.Header.Set("x-ms-client-request-id", *requestID)
// }
// return req, nil
//}
//
//// renameResponder handles the response to the Rename request.
//func (client blobClient) renameResponder(resp pipeline.Response) (pipeline.Response, error) {
// err := validateResponse(resp, http.StatusOK, http.StatusCreated)
// if resp == nil {
// return nil, err
// }
// io.Copy(ioutil.Discard, resp.Response().Body)
// resp.Response().Body.Close()
// return &BlobRenameResponse{rawResponse: resp.Response()}, err
//}
// renameSource is the file or directory to be renamed. The value must have the following format:
// "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties;
// otherwise, the existing properties will be preserved. timeout is the timeout parameter is expressed in seconds. For
// more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> directoryProperties is optional. User-defined properties to be stored
// with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...",
// where each value is base64 encoded. posixPermissions is optional and only valid if Hierarchical Namespace is enabled
// for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may
// be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and
// 4-digit octal notation (e.g. 0766) are supported. posixUmask is only valid if Hierarchical Namespace is enabled for
// the account. This umask restricts permission settings for file and directory, and will only be applied when default
// Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be
// disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation
// (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. cacheControl is cache
// control for given resource contentType is content type for given resource contentEncoding is content encoding for
// given resource contentLanguage is content language for given resource contentDisposition is content disposition for
// given resource leaseID is if specified, the operation only succeeds if the resource's lease is active and matches
// this ID. sourceLeaseID is a lease ID for the source path. If specified, the source path must have an active lease
// and the lease ID must match. ifModifiedSince is specify this header value to operate only on a blob if it has been
// modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if
// it has not been modified since the specified date/time. ifMatch is specify an ETag value to operate only on blobs
// with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
// sourceIfModifiedSince is specify this header value to operate only on a blob if it has been modified since the
// specified date/time. sourceIfUnmodifiedSince is specify this header value to operate only on a blob if it has not
// been modified since the specified date/time. sourceIfMatch is specify an ETag value to operate only on blobs with a
// matching value. sourceIfNoneMatch is specify an ETag value to operate only on blobs without a matching value.
// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
// logs when storage analytics logging is enabled.
func (client blobClient) Rename(ctx context.Context, renameSource string, timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (*BlobRenameResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.renamePreparer(renameSource, timeout, directoryProperties, posixPermissions, posixUmask, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseID, sourceLeaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.renameResponder}, req)
if err != nil {
return nil, err
}
return resp.(*BlobRenameResponse), err
}
// renamePreparer prepares the Rename request.
func (client blobClient) renamePreparer(renameSource string, timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
// if pathRenameMode != PathRenameModeNone {
// params.Set("mode", string(client.PathRenameMode))
// }
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-rename-source", renameSource)
if directoryProperties != nil {
req.Header.Set("x-ms-properties", *directoryProperties)
}
if posixPermissions != nil {
req.Header.Set("x-ms-permissions", *posixPermissions)
}
if posixUmask != nil {
req.Header.Set("x-ms-umask", *posixUmask)
}
if cacheControl != nil {
req.Header.Set("x-ms-cache-control", *cacheControl)
}
if contentType != nil {
req.Header.Set("x-ms-content-type", *contentType)
}
if contentEncoding != nil {
req.Header.Set("x-ms-content-encoding", *contentEncoding)
}
if contentLanguage != nil {
req.Header.Set("x-ms-content-language", *contentLanguage)
}
if contentDisposition != nil {
req.Header.Set("x-ms-content-disposition", *contentDisposition)
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if sourceLeaseID != nil {
req.Header.Set("x-ms-source-lease-id", *sourceLeaseID)
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if sourceIfModifiedSince != nil {
req.Header.Set("x-ms-source-if-modified-since", (*sourceIfModifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfUnmodifiedSince != nil {
req.Header.Set("x-ms-source-if-unmodified-since", (*sourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfMatch != nil {
req.Header.Set("x-ms-source-if-match", string(*sourceIfMatch))
}
if sourceIfNoneMatch != nil {
req.Header.Set("x-ms-source-if-none-match", string(*sourceIfNoneMatch))
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// renameResponder handles the response to the Rename request.
func (client blobClient) renameResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &BlobRenameResponse{rawResponse: resp.Response()}, err
}
// RenewLease [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
// operations
@ -1866,15 +1873,16 @@ func (client blobClient) setMetadataResponder(resp pipeline.Response) (pipeline.
// transactionalContentCrc64 is specify the transactional crc64 for the body, to be validated by the service. requestID
// is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when
// storage analytics logging is enabled. ifTags is specify a SQL where clause on blob tags to operate only on blobs
// with a matching value. tags is blob tags
func (client blobClient) SetTags(ctx context.Context, timeout *int32, versionID *string, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, requestID *string, ifTags *string, tags *BlobTags) (*BlobSetTagsResponse, error) {
// with a matching value. leaseID is if specified, the operation only succeeds if the resource's lease is active and
// matches this ID. tags is blob tags
func (client blobClient) SetTags(ctx context.Context, timeout *int32, versionID *string, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, requestID *string, ifTags *string, leaseID *string, tags *BlobTags) (*BlobSetTagsResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.setTagsPreparer(timeout, versionID, transactionalContentMD5, transactionalContentCrc64, requestID, ifTags, tags)
req, err := client.setTagsPreparer(timeout, versionID, transactionalContentMD5, transactionalContentCrc64, requestID, ifTags, leaseID, tags)
if err != nil {
return nil, err
}
@ -1886,7 +1894,7 @@ func (client blobClient) SetTags(ctx context.Context, timeout *int32, versionID
}
// setTagsPreparer prepares the SetTags request.
func (client blobClient) setTagsPreparer(timeout *int32, versionID *string, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, requestID *string, ifTags *string, tags *BlobTags) (pipeline.Request, error) {
func (client blobClient) setTagsPreparer(timeout *int32, versionID *string, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, requestID *string, ifTags *string, leaseID *string, tags *BlobTags) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -1913,6 +1921,9 @@ func (client blobClient) setTagsPreparer(timeout *int32, versionID *string, tran
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
b, err := xml.Marshal(tags)
if err != nil {
return req, pipeline.NewError(err, "failed to marshal request body")
@ -1952,15 +1963,16 @@ func (client blobClient) setTagsResponder(resp pipeline.Response) (pipeline.Resp
// Timeouts for Blob Service Operations.</a> rehydratePriority is optional: Indicates the priority with which to
// rehydrate an archived blob. requestID is provides a client-generated, opaque value with a 1 KB character limit that
// is recorded in the analytics logs when storage analytics logging is enabled. leaseID is if specified, the operation
// only succeeds if the resource's lease is active and matches this ID.
func (client blobClient) SetTier(ctx context.Context, tier AccessTierType, snapshot *string, versionID *string, timeout *int32, rehydratePriority RehydratePriorityType, requestID *string, leaseID *string) (*BlobSetTierResponse, error) {
// only succeeds if the resource's lease is active and matches this ID. ifTags is specify a SQL where clause on blob
// tags to operate only on blobs with a matching value.
func (client blobClient) SetTier(ctx context.Context, tier AccessTierType, snapshot *string, versionID *string, timeout *int32, rehydratePriority RehydratePriorityType, requestID *string, leaseID *string, ifTags *string) (*BlobSetTierResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.setTierPreparer(tier, snapshot, versionID, timeout, rehydratePriority, requestID, leaseID)
req, err := client.setTierPreparer(tier, snapshot, versionID, timeout, rehydratePriority, requestID, leaseID, ifTags)
if err != nil {
return nil, err
}
@ -1972,7 +1984,7 @@ func (client blobClient) SetTier(ctx context.Context, tier AccessTierType, snaps
}
// setTierPreparer prepares the SetTier request.
func (client blobClient) setTierPreparer(tier AccessTierType, snapshot *string, versionID *string, timeout *int32, rehydratePriority RehydratePriorityType, requestID *string, leaseID *string) (pipeline.Request, error) {
func (client blobClient) setTierPreparer(tier AccessTierType, snapshot *string, versionID *string, timeout *int32, rehydratePriority RehydratePriorityType, requestID *string, leaseID *string, ifTags *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -2000,6 +2012,9 @@ func (client blobClient) setTierPreparer(tier AccessTierType, snapshot *string,
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
return req, nil
}

View file

@ -275,6 +275,188 @@ func (client blockBlobClient) getBlockListResponder(resp pipeline.Response) (pip
return result, nil
}
// PutBlobFromURL the Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from
// a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with
// Put Blob from URL; the content of an existing blob is overwritten with the content of the new blob. To perform
// partial updates to a block blobs contents using a source URL, use the Put Block from URL API in conjunction with
// Put Block List.
//
// contentLength is the length of the request. copySource is specifies the name of the source page blob snapshot. This
// value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it
// would appear in a request URI. The source blob must either be public or must be authenticated via a shared access
// signature. timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> transactionalContentMD5 is specify the transactional md5 for the body, to
// be validated by the service. blobContentType is optional. Sets the blob's content type. If specified, this property
// is stored with the blob and returned with a read request. blobContentEncoding is optional. Sets the blob's content
// encoding. If specified, this property is stored with the blob and returned with a read request. blobContentLanguage
// is optional. Set the blob's content language. If specified, this property is stored with the blob and returned with
// a read request. blobContentMD5 is optional. An MD5 hash of the blob content. Note that this hash is not validated,
// as the hashes for the individual blocks were validated when each was uploaded. blobCacheControl is optional. Sets
// the blob's cache control. If specified, this property is stored with the blob and returned with a read request.
// metadata is optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are
// specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more
// name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not
// copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the
// naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.
// leaseID is if specified, the operation only succeeds if the resource's lease is active and matches this ID.
// blobContentDisposition is optional. Sets the blob's Content-Disposition header. encryptionKey is optional. Specifies
// the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed
// with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services.
// encryptionKeySha256 is the SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key
// header is provided. encryptionAlgorithm is the algorithm used to produce the encryption key hash. Currently, the
// only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is provided. encryptionScope is
// optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data
// provided in the request. If not specified, encryption is performed with the default account encryption scope. For
// more information, see Encryption at Rest for Azure Storage Services. tier is optional. Indicates the tier to be set
// on the blob. ifModifiedSince is specify this header value to operate only on a blob if it has been modified since
// the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been
// modified since the specified date/time. ifMatch is specify an ETag value to operate only on blobs with a matching
// value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. ifTags is specify a
// SQL where clause on blob tags to operate only on blobs with a matching value. sourceIfModifiedSince is specify this
// header value to operate only on a blob if it has been modified since the specified date/time.
// sourceIfUnmodifiedSince is specify this header value to operate only on a blob if it has not been modified since the
// specified date/time. sourceIfMatch is specify an ETag value to operate only on blobs with a matching value.
// sourceIfNoneMatch is specify an ETag value to operate only on blobs without a matching value. sourceIfTags is
// specify a SQL where clause on blob tags to operate only on blobs with a matching value. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled. sourceContentMD5 is specify the md5 calculated for the range of bytes that must be
// read from the copy source. blobTagsString is optional. Used to set blob tags in various blob operations.
// copySourceBlobProperties is optional, default is true. Indicates if properties from the source blob should be
// copied.
func (client blockBlobClient) PutBlobFromURL(ctx context.Context, contentLength int64, copySource string, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, copySourceBlobProperties *bool) (*BlockBlobPutBlobFromURLResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.putBlobFromURLPreparer(contentLength, copySource, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, requestID, sourceContentMD5, blobTagsString, copySourceBlobProperties)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.putBlobFromURLResponder}, req)
if err != nil {
return nil, err
}
return resp.(*BlockBlobPutBlobFromURLResponse), err
}
// putBlobFromURLPreparer prepares the PutBlobFromURL request.
func (client blockBlobClient) putBlobFromURLPreparer(contentLength int64, copySource string, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, copySourceBlobProperties *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
req.URL.RawQuery = params.Encode()
if transactionalContentMD5 != nil {
req.Header.Set("Content-MD5", base64.StdEncoding.EncodeToString(transactionalContentMD5))
}
req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10))
if blobContentType != nil {
req.Header.Set("x-ms-blob-content-type", *blobContentType)
}
if blobContentEncoding != nil {
req.Header.Set("x-ms-blob-content-encoding", *blobContentEncoding)
}
if blobContentLanguage != nil {
req.Header.Set("x-ms-blob-content-language", *blobContentLanguage)
}
if blobContentMD5 != nil {
req.Header.Set("x-ms-blob-content-md5", base64.StdEncoding.EncodeToString(blobContentMD5))
}
if blobCacheControl != nil {
req.Header.Set("x-ms-blob-cache-control", *blobCacheControl)
}
if metadata != nil {
for k, v := range metadata {
req.Header.Set("x-ms-meta-"+k, v)
}
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if blobContentDisposition != nil {
req.Header.Set("x-ms-blob-content-disposition", *blobContentDisposition)
}
if encryptionKey != nil {
req.Header.Set("x-ms-encryption-key", *encryptionKey)
}
if encryptionKeySha256 != nil {
req.Header.Set("x-ms-encryption-key-sha256", *encryptionKeySha256)
}
if encryptionAlgorithm != EncryptionAlgorithmNone {
req.Header.Set("x-ms-encryption-algorithm", string(encryptionAlgorithm))
}
if encryptionScope != nil {
req.Header.Set("x-ms-encryption-scope", *encryptionScope)
}
if tier != AccessTierNone {
req.Header.Set("x-ms-access-tier", string(tier))
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
if sourceIfModifiedSince != nil {
req.Header.Set("x-ms-source-if-modified-since", (*sourceIfModifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfUnmodifiedSince != nil {
req.Header.Set("x-ms-source-if-unmodified-since", (*sourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfMatch != nil {
req.Header.Set("x-ms-source-if-match", string(*sourceIfMatch))
}
if sourceIfNoneMatch != nil {
req.Header.Set("x-ms-source-if-none-match", string(*sourceIfNoneMatch))
}
if sourceIfTags != nil {
req.Header.Set("x-ms-source-if-tags", *sourceIfTags)
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
if sourceContentMD5 != nil {
req.Header.Set("x-ms-source-content-md5", base64.StdEncoding.EncodeToString(sourceContentMD5))
}
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
req.Header.Set("x-ms-copy-source", copySource)
if copySourceBlobProperties != nil {
req.Header.Set("x-ms-copy-source-blob-properties", strconv.FormatBool(*copySourceBlobProperties))
}
req.Header.Set("x-ms-blob-type", "BlockBlob")
return req, nil
}
// putBlobFromURLResponder handles the response to the PutBlobFromURL request.
func (client blockBlobClient) putBlobFromURLResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &BlockBlobPutBlobFromURLResponse{rawResponse: resp.Response()}, err
}
// StageBlock the Stage Block operation creates a new block to be committed as part of a blob
//
// blockID is a valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or

View file

@ -10,7 +10,7 @@ import (
const (
// ServiceVersion specifies the version of the operations used in this package.
ServiceVersion = "2019-12-12"
ServiceVersion = "2020-04-08"
)
// managementClient is the base client for Azblob.

View file

@ -823,6 +823,67 @@ func (client containerClient) releaseLeaseResponder(resp pipeline.Response) (pip
return &ContainerReleaseLeaseResponse{rawResponse: resp.Response()}, err
}
// Rename renames an existing container.
//
// sourceContainerName is required. Specifies the name of the container to rename. timeout is the timeout parameter is
// expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled. sourceLeaseID is a
// lease ID for the source path. If specified, the source path must have an active lease and the lease ID must match.
func (client containerClient) Rename(ctx context.Context, sourceContainerName string, timeout *int32, requestID *string, sourceLeaseID *string) (*ContainerRenameResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.renamePreparer(sourceContainerName, timeout, requestID, sourceLeaseID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.renameResponder}, req)
if err != nil {
return nil, err
}
return resp.(*ContainerRenameResponse), err
}
// renamePreparer prepares the Rename request.
func (client containerClient) renamePreparer(sourceContainerName string, timeout *int32, requestID *string, sourceLeaseID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("restype", "container")
params.Set("comp", "rename")
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
req.Header.Set("x-ms-source-container-name", sourceContainerName)
if sourceLeaseID != nil {
req.Header.Set("x-ms-source-lease-id", *sourceLeaseID)
}
return req, nil
}
// renameResponder handles the response to the Rename request.
func (client containerClient) renameResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &ContainerRenameResponse{rawResponse: resp.Response()}, err
}
// RenewLease [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15
// to 60 seconds, or can be infinite
//
@ -897,8 +958,8 @@ func (client containerClient) renewLeaseResponder(resp pipeline.Response) (pipel
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
// deletedContainerName is optional. Version 2019-12-12 and laster. Specifies the name of the deleted container to
// restore. deletedContainerVersion is optional. Version 2019-12-12 and laster. Specifies the version of the deleted
// deletedContainerName is optional. Version 2019-12-12 and later. Specifies the name of the deleted container to
// restore. deletedContainerVersion is optional. Version 2019-12-12 and later. Specifies the version of the deleted
// container to restore.
func (client containerClient) Restore(ctx context.Context, timeout *int32, requestID *string, deletedContainerName *string, deletedContainerVersion *string) (*ContainerRestoreResponse, error) {
if err := validate([]validation{
@ -1109,3 +1170,63 @@ func (client containerClient) setMetadataResponder(resp pipeline.Response) (pipe
resp.Response().Body.Close()
return &ContainerSetMetadataResponse{rawResponse: resp.Response()}, err
}
// SubmitBatch the Batch operation allows multiple API calls to be embedded into a single HTTP request.
//
// body is initial data body will be closed upon successful return. Callers should ensure closure when receiving an
// error.contentLength is the length of the request. multipartContentType is required. The value of this header must be
// multipart/mixed with a batch boundary. Example header value: multipart/mixed; boundary=batch_<GUID> timeout is the
// timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client containerClient) SubmitBatch(ctx context.Context, body io.ReadSeeker, contentLength int64, multipartContentType string, timeout *int32, requestID *string) (*SubmitBatchResponse, error) {
if err := validate([]validation{
{targetValue: body,
constraints: []constraint{{target: "body", name: null, rule: true, chain: nil}}},
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.submitBatchPreparer(body, contentLength, multipartContentType, timeout, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.submitBatchResponder}, req)
if err != nil {
return nil, err
}
return resp.(*SubmitBatchResponse), err
}
// submitBatchPreparer prepares the SubmitBatch request.
func (client containerClient) submitBatchPreparer(body io.ReadSeeker, contentLength int64, multipartContentType string, timeout *int32, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("POST", client.url, body)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("restype", "container")
params.Set("comp", "batch")
req.URL.RawQuery = params.Encode()
req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10))
req.Header.Set("Content-Type", multipartContentType)
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// submitBatchResponder handles the response to the SubmitBatch request.
func (client containerClient) submitBatchResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
if resp == nil {
return nil, err
}
return &SubmitBatchResponse{rawResponse: resp.Response()}, err
}

View file

@ -174,6 +174,21 @@ func PossibleArchiveStatusTypeValues() []ArchiveStatusType {
return []ArchiveStatusType{ArchiveStatusNone, ArchiveStatusRehydratePendingToCool, ArchiveStatusRehydratePendingToHot}
}
// BlobDeleteType enumerates the values for blob delete type.
type BlobDeleteType string
const (
// BlobDeleteNone represents an empty BlobDeleteType.
BlobDeleteNone BlobDeleteType = ""
// BlobDeletePermanent ...
BlobDeletePermanent BlobDeleteType = "Permanent"
)
// PossibleBlobDeleteTypeValues returns an array of possible values for the BlobDeleteType const type.
func PossibleBlobDeleteTypeValues() []BlobDeleteType {
return []BlobDeleteType{BlobDeleteNone, BlobDeletePermanent}
}
// BlobExpiryOptionsType enumerates the values for blob expiry options type.
type BlobExpiryOptionsType string
@ -479,6 +494,8 @@ func PossiblePublicAccessTypeValues() []PublicAccessType {
type QueryFormatType string
const (
// QueryFormatArrow ...
QueryFormatArrow QueryFormatType = "arrow"
// QueryFormatDelimited ...
QueryFormatDelimited QueryFormatType = "delimited"
// QueryFormatJSON ...
@ -489,7 +506,7 @@ const (
// PossibleQueryFormatTypeValues returns an array of possible values for the QueryFormatType const type.
func PossibleQueryFormatTypeValues() []QueryFormatType {
return []QueryFormatType{QueryFormatDelimited, QueryFormatJSON, QueryFormatNone}
return []QueryFormatType{QueryFormatArrow, QueryFormatDelimited, QueryFormatJSON, QueryFormatNone}
}
// RehydratePriorityType enumerates the values for rehydrate priority type.
@ -583,6 +600,8 @@ const (
StorageErrorCodeBlobArchived StorageErrorCodeType = "BlobArchived"
// StorageErrorCodeBlobBeingRehydrated ...
StorageErrorCodeBlobBeingRehydrated StorageErrorCodeType = "BlobBeingRehydrated"
// StorageErrorCodeBlobImmutableDueToPolicy ...
StorageErrorCodeBlobImmutableDueToPolicy StorageErrorCodeType = "BlobImmutableDueToPolicy"
// StorageErrorCodeBlobNotArchived ...
StorageErrorCodeBlobNotArchived StorageErrorCodeType = "BlobNotArchived"
// StorageErrorCodeBlobNotFound ...
@ -783,7 +802,7 @@ const (
// PossibleStorageErrorCodeTypeValues returns an array of possible values for the StorageErrorCodeType const type.
func PossibleStorageErrorCodeTypeValues() []StorageErrorCodeType {
return []StorageErrorCodeType{StorageErrorCodeAccountAlreadyExists, StorageErrorCodeAccountBeingCreated, StorageErrorCodeAccountIsDisabled, StorageErrorCodeAppendPositionConditionNotMet, StorageErrorCodeAuthenticationFailed, StorageErrorCodeAuthorizationFailure, StorageErrorCodeAuthorizationPermissionMismatch, StorageErrorCodeAuthorizationProtocolMismatch, StorageErrorCodeAuthorizationResourceTypeMismatch, StorageErrorCodeAuthorizationServiceMismatch, StorageErrorCodeAuthorizationSourceIPMismatch, StorageErrorCodeBlobAlreadyExists, StorageErrorCodeBlobArchived, StorageErrorCodeBlobBeingRehydrated, StorageErrorCodeBlobNotArchived, StorageErrorCodeBlobNotFound, StorageErrorCodeBlobOverwritten, StorageErrorCodeBlobTierInadequateForContentLength, StorageErrorCodeBlockCountExceedsLimit, StorageErrorCodeBlockListTooLong, StorageErrorCodeCannotChangeToLowerTier, StorageErrorCodeCannotVerifyCopySource, StorageErrorCodeConditionHeadersNotSupported, StorageErrorCodeConditionNotMet, StorageErrorCodeContainerAlreadyExists, StorageErrorCodeContainerBeingDeleted, StorageErrorCodeContainerDisabled, StorageErrorCodeContainerNotFound, StorageErrorCodeContentLengthLargerThanTierLimit, StorageErrorCodeCopyAcrossAccountsNotSupported, StorageErrorCodeCopyIDMismatch, StorageErrorCodeEmptyMetadataKey, StorageErrorCodeFeatureVersionMismatch, StorageErrorCodeIncrementalCopyBlobMismatch, StorageErrorCodeIncrementalCopyOfEralierVersionSnapshotNotAllowed, StorageErrorCodeIncrementalCopySourceMustBeSnapshot, StorageErrorCodeInfiniteLeaseDurationRequired, StorageErrorCodeInsufficientAccountPermissions, StorageErrorCodeInternalError, StorageErrorCodeInvalidAuthenticationInfo, StorageErrorCodeInvalidBlobOrBlock, StorageErrorCodeInvalidBlobTier, StorageErrorCodeInvalidBlobType, StorageErrorCodeInvalidBlockID, StorageErrorCodeInvalidBlockList, StorageErrorCodeInvalidHeaderValue, StorageErrorCodeInvalidHTTPVerb, StorageErrorCodeInvalidInput, StorageErrorCodeInvalidMd5, StorageErrorCodeInvalidMetadata, StorageErrorCodeInvalidOperation, StorageErrorCodeInvalidPageRange, StorageErrorCodeInvalidQueryParameterValue, StorageErrorCodeInvalidRange, StorageErrorCodeInvalidResourceName, StorageErrorCodeInvalidSourceBlobType, StorageErrorCodeInvalidSourceBlobURL, StorageErrorCodeInvalidURI, StorageErrorCodeInvalidVersionForPageBlobOperation, StorageErrorCodeInvalidXMLDocument, StorageErrorCodeInvalidXMLNodeValue, StorageErrorCodeLeaseAlreadyBroken, StorageErrorCodeLeaseAlreadyPresent, StorageErrorCodeLeaseIDMismatchWithBlobOperation, StorageErrorCodeLeaseIDMismatchWithContainerOperation, StorageErrorCodeLeaseIDMismatchWithLeaseOperation, StorageErrorCodeLeaseIDMissing, StorageErrorCodeLeaseIsBreakingAndCannotBeAcquired, StorageErrorCodeLeaseIsBreakingAndCannotBeChanged, StorageErrorCodeLeaseIsBrokenAndCannotBeRenewed, StorageErrorCodeLeaseLost, StorageErrorCodeLeaseNotPresentWithBlobOperation, StorageErrorCodeLeaseNotPresentWithContainerOperation, StorageErrorCodeLeaseNotPresentWithLeaseOperation, StorageErrorCodeMaxBlobSizeConditionNotMet, StorageErrorCodeMd5Mismatch, StorageErrorCodeMetadataTooLarge, StorageErrorCodeMissingContentLengthHeader, StorageErrorCodeMissingRequiredHeader, StorageErrorCodeMissingRequiredQueryParameter, StorageErrorCodeMissingRequiredXMLNode, StorageErrorCodeMultipleConditionHeadersNotSupported, StorageErrorCodeNoAuthenticationInformation, StorageErrorCodeNone, StorageErrorCodeNoPendingCopyOperation, StorageErrorCodeOperationNotAllowedOnIncrementalCopyBlob, StorageErrorCodeOperationTimedOut, StorageErrorCodeOutOfRangeInput, StorageErrorCodeOutOfRangeQueryParameterValue, StorageErrorCodePendingCopyOperation, StorageErrorCodePreviousSnapshotCannotBeNewer, StorageErrorCodePreviousSnapshotNotFound, StorageErrorCodePreviousSnapshotOperationNotSupported, StorageErrorCodeRequestBodyTooLarge, StorageErrorCodeRequestURLFailedToParse, StorageErrorCodeResourceAlreadyExists, StorageErrorCodeResourceNotFound, StorageErrorCodeResourceTypeMismatch, StorageErrorCodeSequenceNumberConditionNotMet, StorageErrorCodeSequenceNumberIncrementTooLarge, StorageErrorCodeServerBusy, StorageErrorCodeSnaphotOperationRateExceeded, StorageErrorCodeSnapshotCountExceeded, StorageErrorCodeSnapshotsPresent, StorageErrorCodeSourceConditionNotMet, StorageErrorCodeSystemInUse, StorageErrorCodeTargetConditionNotMet, StorageErrorCodeUnauthorizedBlobOverwrite, StorageErrorCodeUnsupportedHeader, StorageErrorCodeUnsupportedHTTPVerb, StorageErrorCodeUnsupportedQueryParameter, StorageErrorCodeUnsupportedXMLNode}
return []StorageErrorCodeType{StorageErrorCodeAccountAlreadyExists, StorageErrorCodeAccountBeingCreated, StorageErrorCodeAccountIsDisabled, StorageErrorCodeAppendPositionConditionNotMet, StorageErrorCodeAuthenticationFailed, StorageErrorCodeAuthorizationFailure, StorageErrorCodeAuthorizationPermissionMismatch, StorageErrorCodeAuthorizationProtocolMismatch, StorageErrorCodeAuthorizationResourceTypeMismatch, StorageErrorCodeAuthorizationServiceMismatch, StorageErrorCodeAuthorizationSourceIPMismatch, StorageErrorCodeBlobAlreadyExists, StorageErrorCodeBlobArchived, StorageErrorCodeBlobBeingRehydrated, StorageErrorCodeBlobImmutableDueToPolicy, StorageErrorCodeBlobNotArchived, StorageErrorCodeBlobNotFound, StorageErrorCodeBlobOverwritten, StorageErrorCodeBlobTierInadequateForContentLength, StorageErrorCodeBlockCountExceedsLimit, StorageErrorCodeBlockListTooLong, StorageErrorCodeCannotChangeToLowerTier, StorageErrorCodeCannotVerifyCopySource, StorageErrorCodeConditionHeadersNotSupported, StorageErrorCodeConditionNotMet, StorageErrorCodeContainerAlreadyExists, StorageErrorCodeContainerBeingDeleted, StorageErrorCodeContainerDisabled, StorageErrorCodeContainerNotFound, StorageErrorCodeContentLengthLargerThanTierLimit, StorageErrorCodeCopyAcrossAccountsNotSupported, StorageErrorCodeCopyIDMismatch, StorageErrorCodeEmptyMetadataKey, StorageErrorCodeFeatureVersionMismatch, StorageErrorCodeIncrementalCopyBlobMismatch, StorageErrorCodeIncrementalCopyOfEralierVersionSnapshotNotAllowed, StorageErrorCodeIncrementalCopySourceMustBeSnapshot, StorageErrorCodeInfiniteLeaseDurationRequired, StorageErrorCodeInsufficientAccountPermissions, StorageErrorCodeInternalError, StorageErrorCodeInvalidAuthenticationInfo, StorageErrorCodeInvalidBlobOrBlock, StorageErrorCodeInvalidBlobTier, StorageErrorCodeInvalidBlobType, StorageErrorCodeInvalidBlockID, StorageErrorCodeInvalidBlockList, StorageErrorCodeInvalidHeaderValue, StorageErrorCodeInvalidHTTPVerb, StorageErrorCodeInvalidInput, StorageErrorCodeInvalidMd5, StorageErrorCodeInvalidMetadata, StorageErrorCodeInvalidOperation, StorageErrorCodeInvalidPageRange, StorageErrorCodeInvalidQueryParameterValue, StorageErrorCodeInvalidRange, StorageErrorCodeInvalidResourceName, StorageErrorCodeInvalidSourceBlobType, StorageErrorCodeInvalidSourceBlobURL, StorageErrorCodeInvalidURI, StorageErrorCodeInvalidVersionForPageBlobOperation, StorageErrorCodeInvalidXMLDocument, StorageErrorCodeInvalidXMLNodeValue, StorageErrorCodeLeaseAlreadyBroken, StorageErrorCodeLeaseAlreadyPresent, StorageErrorCodeLeaseIDMismatchWithBlobOperation, StorageErrorCodeLeaseIDMismatchWithContainerOperation, StorageErrorCodeLeaseIDMismatchWithLeaseOperation, StorageErrorCodeLeaseIDMissing, StorageErrorCodeLeaseIsBreakingAndCannotBeAcquired, StorageErrorCodeLeaseIsBreakingAndCannotBeChanged, StorageErrorCodeLeaseIsBrokenAndCannotBeRenewed, StorageErrorCodeLeaseLost, StorageErrorCodeLeaseNotPresentWithBlobOperation, StorageErrorCodeLeaseNotPresentWithContainerOperation, StorageErrorCodeLeaseNotPresentWithLeaseOperation, StorageErrorCodeMaxBlobSizeConditionNotMet, StorageErrorCodeMd5Mismatch, StorageErrorCodeMetadataTooLarge, StorageErrorCodeMissingContentLengthHeader, StorageErrorCodeMissingRequiredHeader, StorageErrorCodeMissingRequiredQueryParameter, StorageErrorCodeMissingRequiredXMLNode, StorageErrorCodeMultipleConditionHeadersNotSupported, StorageErrorCodeNoAuthenticationInformation, StorageErrorCodeNone, StorageErrorCodeNoPendingCopyOperation, StorageErrorCodeOperationNotAllowedOnIncrementalCopyBlob, StorageErrorCodeOperationTimedOut, StorageErrorCodeOutOfRangeInput, StorageErrorCodeOutOfRangeQueryParameterValue, StorageErrorCodePendingCopyOperation, StorageErrorCodePreviousSnapshotCannotBeNewer, StorageErrorCodePreviousSnapshotNotFound, StorageErrorCodePreviousSnapshotOperationNotSupported, StorageErrorCodeRequestBodyTooLarge, StorageErrorCodeRequestURLFailedToParse, StorageErrorCodeResourceAlreadyExists, StorageErrorCodeResourceNotFound, StorageErrorCodeResourceTypeMismatch, StorageErrorCodeSequenceNumberConditionNotMet, StorageErrorCodeSequenceNumberIncrementTooLarge, StorageErrorCodeServerBusy, StorageErrorCodeSnaphotOperationRateExceeded, StorageErrorCodeSnapshotCountExceeded, StorageErrorCodeSnapshotsPresent, StorageErrorCodeSourceConditionNotMet, StorageErrorCodeSystemInUse, StorageErrorCodeTargetConditionNotMet, StorageErrorCodeUnauthorizedBlobOverwrite, StorageErrorCodeUnsupportedHeader, StorageErrorCodeUnsupportedHTTPVerb, StorageErrorCodeUnsupportedQueryParameter, StorageErrorCodeUnsupportedXMLNode}
}
// SyncCopyStatusType enumerates the values for sync copy status type.
@ -1258,6 +1277,21 @@ func (absr AppendBlobSealResponse) Version() string {
return absr.rawResponse.Header.Get("x-ms-version")
}
// ArrowConfiguration - arrow configuration
type ArrowConfiguration struct {
Schema []ArrowField `xml:"Schema>Field"`
}
// ArrowField - field of an arrow schema
type ArrowField struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Field"`
Type string `xml:"Type"`
Name *string `xml:"Name"`
Precision *int32 `xml:"Precision"`
Scale *int32 `xml:"Scale"`
}
// BlobAbortCopyFromURLResponse ...
type BlobAbortCopyFromURLResponse struct {
rawResponse *http.Response
@ -2229,6 +2263,19 @@ func (bgpr BlobGetPropertiesResponse) IsServerEncrypted() string {
return bgpr.rawResponse.Header.Get("x-ms-server-encrypted")
}
// LastAccessed returns the value for header x-ms-last-access-time.
func (bgpr BlobGetPropertiesResponse) LastAccessed() time.Time {
s := bgpr.rawResponse.Header.Get("x-ms-last-access-time")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// LastModified returns the value for header Last-Modified.
func (bgpr BlobGetPropertiesResponse) LastModified() time.Time {
s := bgpr.rawResponse.Header.Get("Last-Modified")
@ -2311,15 +2358,13 @@ type BlobHierarchyListSegment struct {
// BlobItemInternal - An Azure Storage blob
type BlobItemInternal struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
Deleted bool `xml:"Deleted"`
Snapshot string `xml:"Snapshot"`
VersionID *string `xml:"VersionId"`
IsCurrentVersion *bool `xml:"IsCurrentVersion"`
Properties BlobProperties `xml:"Properties"`
// TODO funky generator type -> *BlobMetadata
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
Deleted bool `xml:"Deleted"`
Snapshot string `xml:"Snapshot"`
VersionID *string `xml:"VersionId"`
IsCurrentVersion *bool `xml:"IsCurrentVersion"`
Properties BlobProperties `xml:"Properties"`
Metadata Metadata `xml:"Metadata"`
BlobTags *BlobTags `xml:"Tags"`
ObjectReplicationMetadata map[string]string `xml:"ObjectReplicationMetadata"`
@ -2386,18 +2431,19 @@ type BlobProperties struct {
AccessTierChangeTime *time.Time `xml:"AccessTierChangeTime"`
TagCount *int32 `xml:"TagCount"`
ExpiresOn *time.Time `xml:"Expiry-Time"`
IsSealed *bool `xml:"IsSealed"`
IsSealed *bool `xml:"Sealed"`
// RehydratePriority - Possible values include: 'RehydratePriorityHigh', 'RehydratePriorityStandard', 'RehydratePriorityNone'
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *time.Time `xml:"LastAccessTime"`
}
// MarshalXML implements the xml.Marshaler interface for BlobProperties.
// MarshalXML implements the xml.Marshaler interface for BlobPropertiesInternal.
func (bpi BlobProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
bpi2 := (*blobProperties)(unsafe.Pointer(&bpi))
return e.EncodeElement(*bpi2, start)
}
// UnmarshalXML implements the xml.Unmarshaler interface for BlobProperties.
// UnmarshalXML implements the xml.Unmarshaler interface for BlobPropertiesInternal.
func (bpi *BlobProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
bpi2 := (*blobProperties)(unsafe.Pointer(bpi))
return d.DecodeElement(bpi2, &start)
@ -3242,7 +3288,7 @@ type Block struct {
// Name - The base64 encoded block ID.
Name string `xml:"Name"`
// Size - The block size in bytes.
Size int64 `xml:"Size"`
Size int32 `xml:"Size"`
}
// BlockBlobCommitBlockListResponse ...
@ -3362,6 +3408,110 @@ func (bbcblr BlockBlobCommitBlockListResponse) XMsContentCrc64() []byte {
return b
}
// BlockBlobPutBlobFromURLResponse ...
type BlockBlobPutBlobFromURLResponse struct {
rawResponse *http.Response
}
// Response returns the raw HTTP response object.
func (bbpbfur BlockBlobPutBlobFromURLResponse) Response() *http.Response {
return bbpbfur.rawResponse
}
// StatusCode returns the HTTP status code of the response, e.g. 200.
func (bbpbfur BlockBlobPutBlobFromURLResponse) StatusCode() int {
return bbpbfur.rawResponse.StatusCode
}
// Status returns the HTTP status message of the response, e.g. "200 OK".
func (bbpbfur BlockBlobPutBlobFromURLResponse) Status() string {
return bbpbfur.rawResponse.Status
}
// ClientRequestID returns the value for header x-ms-client-request-id.
func (bbpbfur BlockBlobPutBlobFromURLResponse) ClientRequestID() string {
return bbpbfur.rawResponse.Header.Get("x-ms-client-request-id")
}
// ContentMD5 returns the value for header Content-MD5.
func (bbpbfur BlockBlobPutBlobFromURLResponse) ContentMD5() []byte {
s := bbpbfur.rawResponse.Header.Get("Content-MD5")
if s == "" {
return nil
}
b, err := base64.StdEncoding.DecodeString(s)
if err != nil {
b = nil
}
return b
}
// Date returns the value for header Date.
func (bbpbfur BlockBlobPutBlobFromURLResponse) Date() time.Time {
s := bbpbfur.rawResponse.Header.Get("Date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// EncryptionKeySha256 returns the value for header x-ms-encryption-key-sha256.
func (bbpbfur BlockBlobPutBlobFromURLResponse) EncryptionKeySha256() string {
return bbpbfur.rawResponse.Header.Get("x-ms-encryption-key-sha256")
}
// EncryptionScope returns the value for header x-ms-encryption-scope.
func (bbpbfur BlockBlobPutBlobFromURLResponse) EncryptionScope() string {
return bbpbfur.rawResponse.Header.Get("x-ms-encryption-scope")
}
// ErrorCode returns the value for header x-ms-error-code.
func (bbpbfur BlockBlobPutBlobFromURLResponse) ErrorCode() string {
return bbpbfur.rawResponse.Header.Get("x-ms-error-code")
}
// ETag returns the value for header ETag.
func (bbpbfur BlockBlobPutBlobFromURLResponse) ETag() ETag {
return ETag(bbpbfur.rawResponse.Header.Get("ETag"))
}
// IsServerEncrypted returns the value for header x-ms-request-server-encrypted.
func (bbpbfur BlockBlobPutBlobFromURLResponse) IsServerEncrypted() string {
return bbpbfur.rawResponse.Header.Get("x-ms-request-server-encrypted")
}
// LastModified returns the value for header Last-Modified.
func (bbpbfur BlockBlobPutBlobFromURLResponse) LastModified() time.Time {
s := bbpbfur.rawResponse.Header.Get("Last-Modified")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// RequestID returns the value for header x-ms-request-id.
func (bbpbfur BlockBlobPutBlobFromURLResponse) RequestID() string {
return bbpbfur.rawResponse.Header.Get("x-ms-request-id")
}
// Version returns the value for header x-ms-version.
func (bbpbfur BlockBlobPutBlobFromURLResponse) Version() string {
return bbpbfur.rawResponse.Header.Get("x-ms-version")
}
// VersionID returns the value for header x-ms-version-id.
func (bbpbfur BlockBlobPutBlobFromURLResponse) VersionID() string {
return bbpbfur.rawResponse.Header.Get("x-ms-version-id")
}
// BlockBlobStageBlockFromURLResponse ...
type BlockBlobStageBlockFromURLResponse struct {
rawResponse *http.Response
@ -4421,6 +4571,59 @@ func (crlr ContainerReleaseLeaseResponse) Version() string {
return crlr.rawResponse.Header.Get("x-ms-version")
}
// ContainerRenameResponse ...
type ContainerRenameResponse struct {
rawResponse *http.Response
}
// Response returns the raw HTTP response object.
func (crr ContainerRenameResponse) Response() *http.Response {
return crr.rawResponse
}
// StatusCode returns the HTTP status code of the response, e.g. 200.
func (crr ContainerRenameResponse) StatusCode() int {
return crr.rawResponse.StatusCode
}
// Status returns the HTTP status message of the response, e.g. "200 OK".
func (crr ContainerRenameResponse) Status() string {
return crr.rawResponse.Status
}
// ClientRequestID returns the value for header x-ms-client-request-id.
func (crr ContainerRenameResponse) ClientRequestID() string {
return crr.rawResponse.Header.Get("x-ms-client-request-id")
}
// Date returns the value for header Date.
func (crr ContainerRenameResponse) Date() time.Time {
s := crr.rawResponse.Header.Get("Date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ErrorCode returns the value for header x-ms-error-code.
func (crr ContainerRenameResponse) ErrorCode() string {
return crr.rawResponse.Header.Get("x-ms-error-code")
}
// RequestID returns the value for header x-ms-request-id.
func (crr ContainerRenameResponse) RequestID() string {
return crr.rawResponse.Header.Get("x-ms-request-id")
}
// Version returns the value for header x-ms-version.
func (crr ContainerRenameResponse) Version() string {
return crr.rawResponse.Header.Get("x-ms-version")
}
// ContainerRenewLeaseResponse ...
type ContainerRenewLeaseResponse struct {
rawResponse *http.Response
@ -5339,6 +5542,11 @@ func (dr downloadResponse) ETag() ETag {
return ETag(dr.rawResponse.Header.Get("ETag"))
}
// IsCurrentVersion returns the value for header x-ms-is-current-version.
func (dr downloadResponse) IsCurrentVersion() string {
return dr.rawResponse.Header.Get("x-ms-is-current-version")
}
// IsSealed returns the value for header x-ms-blob-sealed.
func (dr downloadResponse) IsSealed() string {
return dr.rawResponse.Header.Get("x-ms-blob-sealed")
@ -5349,6 +5557,19 @@ func (dr downloadResponse) IsServerEncrypted() string {
return dr.rawResponse.Header.Get("x-ms-server-encrypted")
}
// LastAccessed returns the value for header x-ms-last-access-time.
func (dr downloadResponse) LastAccessed() time.Time {
s := dr.rawResponse.Header.Get("x-ms-last-access-time")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// LastModified returns the value for header Last-Modified.
func (dr downloadResponse) LastModified() time.Time {
s := dr.rawResponse.Header.Get("Last-Modified")
@ -5418,10 +5639,10 @@ func (dr downloadResponse) VersionID() string {
// FilterBlobItem - Blob info from a Filter Blobs API call
type FilterBlobItem struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
ContainerName string `xml:"ContainerName"`
TagValue string `xml:"TagValue"`
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
ContainerName string `xml:"ContainerName"`
Tags *BlobTags `xml:"Tags"`
}
// FilterBlobSegment - The result of a Filter Blobs API call
@ -6528,10 +6749,11 @@ type PageRange struct {
// QueryFormat ...
type QueryFormat struct {
// Type - Possible values include: 'QueryFormatDelimited', 'QueryFormatJSON', 'QueryFormatNone'
// Type - Possible values include: 'QueryFormatDelimited', 'QueryFormatJSON', 'QueryFormatArrow', 'QueryFormatNone'
Type QueryFormatType `xml:"Type"`
DelimitedTextConfiguration *DelimitedTextConfiguration `xml:"DelimitedTextConfiguration"`
JSONTextConfiguration *JSONTextConfiguration `xml:"JsonTextConfiguration"`
ArrowConfiguration *ArrowConfiguration `xml:"ArrowConfiguration"`
}
// QueryRequest - the quick query body
@ -6830,6 +7052,8 @@ type RetentionPolicy struct {
Enabled bool `xml:"Enabled"`
// Days - Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted
Days *int32 `xml:"Days"`
// AllowPermanentDelete - Indicates whether permanent delete is allowed on this storage account.
AllowPermanentDelete *bool `xml:"AllowPermanentDelete"`
}
// ServiceGetAccountInfoResponse ...
@ -6880,6 +7104,11 @@ func (sgair ServiceGetAccountInfoResponse) ErrorCode() string {
return sgair.rawResponse.Header.Get("x-ms-error-code")
}
// IsHierarchicalNamespaceEnabled returns the value for header x-ms-is-hns-enabled.
func (sgair ServiceGetAccountInfoResponse) IsHierarchicalNamespaceEnabled() string {
return sgair.rawResponse.Header.Get("x-ms-is-hns-enabled")
}
// RequestID returns the value for header x-ms-request-id.
func (sgair ServiceGetAccountInfoResponse) RequestID() string {
return sgair.rawResponse.Header.Get("x-ms-request-id")
@ -7031,6 +7260,11 @@ type StaticWebsite struct {
DefaultIndexDocumentPath *string `xml:"DefaultIndexDocumentPath"`
}
// StorageError ...
// type StorageError struct {
// Message *string `xml:"Message"`
// }
// StorageServiceProperties - Storage Service Properties.
type StorageServiceProperties struct {
rawResponse *http.Response
@ -7134,7 +7368,7 @@ func (sss StorageServiceStats) Version() string {
return sss.rawResponse.Header.Get("x-ms-version")
}
// SubmitBatchResponse - Wraps the response from the serviceClient.SubmitBatch method.
// SubmitBatchResponse - Wraps the response from the containerClient.SubmitBatch method.
type SubmitBatchResponse struct {
rawResponse *http.Response
}
@ -7266,7 +7500,7 @@ func init() {
validateError(errors.New("size mismatch between AccessPolicy and accessPolicy"))
}
if reflect.TypeOf((*BlobProperties)(nil)).Elem().Size() != reflect.TypeOf((*blobProperties)(nil)).Elem().Size() {
validateError(errors.New("size mismatch between BlobProperties and blobProperties"))
validateError(errors.New("size mismatch between BlobPropertiesInternal and blobPropertiesInternal"))
}
if reflect.TypeOf((*ContainerProperties)(nil)).Elem().Size() != reflect.TypeOf((*containerProperties)(nil)).Elem().Size() {
validateError(errors.New("size mismatch between ContainerProperties and containerProperties"))
@ -7277,7 +7511,7 @@ func init() {
}
const (
rfc3339Format = "2006-01-02T15:04:05Z" //This was wrong in the generated code, FYI
rfc3339Format = "2006-01-02T15:04:05Z"
)
// used to convert times from UTC to GMT before sending across the wire
@ -7392,8 +7626,9 @@ type blobProperties struct {
AccessTierChangeTime *timeRFC1123 `xml:"AccessTierChangeTime"`
TagCount *int32 `xml:"TagCount"`
ExpiresOn *timeRFC1123 `xml:"Expiry-Time"`
IsSealed *bool `xml:"IsSealed"`
IsSealed *bool `xml:"Sealed"`
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *timeRFC1123 `xml:"LastAccessTime"`
}
// internal type used for marshalling

View file

@ -48,16 +48,17 @@ func newPageBlobClient(url url.URL, p pipeline.Pipeline) pageBlobClient {
// on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
// operate only on a blob if it has not been modified since the specified date/time. ifMatch is specify an ETag value
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) ClearPages(ctx context.Context, contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobClearPagesResponse, error) {
// without a matching value. ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
// analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) ClearPages(ctx context.Context, contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (*PageBlobClearPagesResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.clearPagesPreparer(contentLength, timeout, rangeParameter, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
req, err := client.clearPagesPreparer(contentLength, timeout, rangeParameter, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID)
if err != nil {
return nil, err
}
@ -69,7 +70,7 @@ func (client pageBlobClient) ClearPages(ctx context.Context, contentLength int64
}
// clearPagesPreparer prepares the ClearPages request.
func (client pageBlobClient) clearPagesPreparer(contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
func (client pageBlobClient) clearPagesPreparer(contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -120,6 +121,9 @@ func (client pageBlobClient) clearPagesPreparer(contentLength int64, timeout *in
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
@ -153,16 +157,17 @@ func (client pageBlobClient) clearPagesResponder(resp pipeline.Response) (pipeli
// it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only
// on a blob if it has not been modified since the specified date/time. ifMatch is specify an ETag value to operate
// only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a
// matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded
// in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) CopyIncremental(ctx context.Context, copySource string, timeout *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobCopyIncrementalResponse, error) {
// matching value. ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching value.
// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
// logs when storage analytics logging is enabled.
func (client pageBlobClient) CopyIncremental(ctx context.Context, copySource string, timeout *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (*PageBlobCopyIncrementalResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.copyIncrementalPreparer(copySource, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
req, err := client.copyIncrementalPreparer(copySource, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID)
if err != nil {
return nil, err
}
@ -174,7 +179,7 @@ func (client pageBlobClient) CopyIncremental(ctx context.Context, copySource str
}
// copyIncrementalPreparer prepares the CopyIncremental request.
func (client pageBlobClient) copyIncrementalPreparer(copySource string, timeout *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
func (client pageBlobClient) copyIncrementalPreparer(copySource string, timeout *int32, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -197,6 +202,9 @@ func (client pageBlobClient) copyIncrementalPreparer(copySource string, timeout
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
req.Header.Set("x-ms-copy-source", copySource)
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
@ -601,17 +609,18 @@ func (client pageBlobClient) getPageRangesDiffResponder(resp pipeline.Response)
// Services. ifModifiedSince is specify this header value to operate only on a blob if it has been modified since the
// specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been
// modified since the specified date/time. ifMatch is specify an ETag value to operate only on blobs with a matching
// value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. requestID is provides
// a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. ifTags is specify a
// SQL where clause on blob tags to operate only on blobs with a matching value. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client pageBlobClient) Resize(ctx context.Context, blobContentLength int64, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobResizeResponse, error) {
func (client pageBlobClient) Resize(ctx context.Context, blobContentLength int64, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (*PageBlobResizeResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.resizePreparer(blobContentLength, timeout, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
req, err := client.resizePreparer(blobContentLength, timeout, leaseID, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID)
if err != nil {
return nil, err
}
@ -623,7 +632,7 @@ func (client pageBlobClient) Resize(ctx context.Context, blobContentLength int64
}
// resizePreparer prepares the Resize request.
func (client pageBlobClient) resizePreparer(blobContentLength int64, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
func (client pageBlobClient) resizePreparer(blobContentLength int64, timeout *int32, leaseID *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -661,6 +670,9 @@ func (client pageBlobClient) resizePreparer(blobContentLength int64, timeout *in
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
req.Header.Set("x-ms-blob-content-length", strconv.FormatInt(blobContentLength, 10))
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
@ -691,18 +703,18 @@ func (client pageBlobClient) resizeResponder(resp pipeline.Response) (pipeline.R
// has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a
// blob if it has not been modified since the specified date/time. ifMatch is specify an ETag value to operate only on
// blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
// blobSequenceNumber is set for page blobs only. The sequence number is a user-controlled value that you can use to
// track requests. The value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, blobSequenceNumber *int64, requestID *string) (*PageBlobUpdateSequenceNumberResponse, error) {
// ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching value. blobSequenceNumber
// is set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The
// value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a client-generated, opaque value
// with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string) (*PageBlobUpdateSequenceNumberResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.updateSequenceNumberPreparer(sequenceNumberAction, timeout, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, blobSequenceNumber, requestID)
req, err := client.updateSequenceNumberPreparer(sequenceNumberAction, timeout, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestID)
if err != nil {
return nil, err
}
@ -714,7 +726,7 @@ func (client pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequenceN
}
// updateSequenceNumberPreparer prepares the UpdateSequenceNumber request.
func (client pageBlobClient) updateSequenceNumberPreparer(sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
func (client pageBlobClient) updateSequenceNumberPreparer(sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -740,6 +752,9 @@ func (client pageBlobClient) updateSequenceNumberPreparer(sequenceNumberAction S
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifTags != nil {
req.Header.Set("x-ms-if-tags", *ifTags)
}
req.Header.Set("x-ms-sequence-number-action", string(sequenceNumberAction))
if blobSequenceNumber != nil {
req.Header.Set("x-ms-blob-sequence-number", strconv.FormatInt(*blobSequenceNumber, 10))

View file

@ -5,7 +5,7 @@ package azblob
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/0.0.0 azblob/2019-12-12"
return "Azure-SDK-For-Go/0.0.0 azblob/2020-04-08"
}
// Version returns the semantic version (see http://semver.org) of the client.

View file

@ -45,7 +45,7 @@ func (dr downloadResponse) NewHTTPHeaders() BlobHTTPHeaders {
///////////////////////////////////////////////////////////////////////////////
// DownloadResponse wraps AutoRest generated DownloadResponse and helps to provide info for retry.
// downloadResponse wraps AutoRest generated downloadResponse and helps to provide info for retry.
type DownloadResponse struct {
r *downloadResponse
ctx context.Context

View file

@ -1,5 +1,3 @@
The MIT License (MIT)
Copyright 2012 Keith Rarick
Permission is hereby granted, free of charge, to any person obtaining a copy

View file

@ -37,7 +37,7 @@ func (fo formatter) passThrough(f fmt.State, c rune) {
s := "%"
for i := 0; i < 128; i++ {
if f.Flag(i) {
s += string(i)
s += string(rune(i))
}
}
if w, ok := f.Width(); ok {
@ -125,7 +125,6 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) {
}
keys := v.MapKeys()
for i := 0; i < v.Len(); i++ {
showTypeInStruct := true
k := keys[i]
mv := v.MapIndex(k)
pp.printValue(k, false, true)
@ -133,7 +132,7 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) {
if expand {
writeByte(pp, '\t')
}
showTypeInStruct = t.Elem().Kind() == reflect.Interface
showTypeInStruct := t.Elem().Kind() == reflect.Interface
pp.printValue(mv, showTypeInStruct, true)
if expand {
io.WriteString(pp, ",\n")

6
vendor/github.com/kr/pretty/go.mod generated vendored
View file

@ -1,3 +1,5 @@
module "github.com/kr/pretty"
module github.com/kr/pretty
require "github.com/kr/text" v0.1.0
go 1.12
require github.com/kr/text v0.1.0

3
vendor/github.com/kr/pretty/go.sum generated vendored Normal file
View file

@ -0,0 +1,3 @@
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=

View file

@ -75,7 +75,7 @@ func Printf(format string, a ...interface{}) (n int, errno error) {
// Println pretty-prints its operands and writes to standard output.
//
// Calling Print(x, y) is equivalent to
// Calling Println(x, y) is equivalent to
// fmt.Println(Formatter(x), Formatter(y)), but each operand is
// formatted with "%# v".
func Println(a ...interface{}) (n int, errno error) {

4
vendor/modules.txt vendored
View file

@ -25,7 +25,7 @@ github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources
github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources
github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage
github.com/Azure/azure-sdk-for-go/version
# github.com/Azure/azure-storage-blob-go v0.13.0
# github.com/Azure/azure-storage-blob-go v0.14.0
## explicit
github.com/Azure/azure-storage-blob-go/azblob
# github.com/Azure/go-autorest v14.2.0+incompatible
@ -227,7 +227,7 @@ github.com/julienschmidt/httprouter
# github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b
## explicit
github.com/kolo/xmlrpc
# github.com/kr/pretty v0.1.0
# github.com/kr/pretty v0.2.1
github.com/kr/pretty
# github.com/kr/text v0.1.0
github.com/kr/text