/// <summary>
 /// Clears legal hold tags. Clearing the same or non-existent tag results in an
 /// idempotent operation. ClearLegalHold clears out only the specified tags in
 /// the request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='tags'>
 /// Each tag should be 3 to 23 alphanumeric characters and is normalized to
 /// lower case at SRP.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LegalHoldInner> ClearLegalHoldAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, IList <string> tags, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ClearLegalHoldWithHttpMessagesAsync(resourceGroupName, accountName, containerName, tags, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists all containers and does not support a prefix like data plane. Also
 /// SRP today does not return continuation token.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ListContainerItemsInner> ListAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// The Lease Container operation establishes and manages a lock on a container
 /// for delete operations. The lock duration can be 15 to 60 seconds, or can be
 /// infinite.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='parameters'>
 /// Lease Container request body.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LeaseContainerResponseInner> LeaseAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, LeaseContainerRequest parameters = default(LeaseContainerRequest), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.LeaseWithHttpMessagesAsync(resourceGroupName, accountName, containerName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new container under the specified account as described by request
 /// body. The container resource includes metadata and properties for that
 /// container. It does not include a list of the blobs contained by the
 /// container.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='publicAccess'>
 /// Specifies whether data in the container may be accessed publicly and the
 /// level of access. Possible values include: 'Container', 'Blob', 'None'
 /// </param>
 /// <param name='metadata'>
 /// A name-value pair to associate with the container as metadata.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BlobContainerInner> CreateAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, PublicAccess?publicAccess = default(PublicAccess?), IDictionary <string, string> metadata = default(IDictionary <string, string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, containerName, publicAccess, metadata, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#5
0
 /// <summary>
 /// Extends the immutabilityPeriodSinceCreationInDays of a locked
 /// immutabilityPolicy. The only action allowed on a Locked policy will be this
 /// action. ETag in If-Match is required for this operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='ifMatch'>
 /// The entity state (ETag) version of the immutability policy to update. A
 /// value of "*" can be used to apply the operation only if the immutability
 /// policy already exists. If omitted, this operation will always be applied.
 /// </param>
 /// <param name='immutabilityPeriodSinceCreationInDays'>
 /// The immutability period for the blobs in the container since the policy
 /// creation, in days.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ImmutabilityPolicy> ExtendImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ExtendImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        public override async Task <Microsoft.Azure.Management.Storage.Fluent.IImmutabilityPolicy> CreateResourceAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            IBlobContainersOperations client = this.manager.Inner.BlobContainers;
            ImmutabilityPolicyInner   immutabilityPolicyInner = await client.CreateOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays, this.cifMatch);

            this.SetInner(immutabilityPolicyInner);
            return(this);
        }
示例#7
0
        private async Task <Microsoft.Azure.Management.Storage.Fluent.IBlobContainer> UpdateResourceAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            IBlobContainersOperations client = this.manager.Inner.BlobContainers;
            var blobContainerInner           = await client.UpdateAsync(this.resourceGroupName, this.accountName, this.containerName, this.upublicAccess, this.umetadata);

            this.SetInner(blobContainerInner);
            return(this);
        }
示例#8
0
        public async override Task <Microsoft.Azure.Management.Storage.Fluent.IBlobContainer> CreateResourceAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            if (IsInCreateMode())
            {
                IBlobContainersOperations client = this.manager.Inner.BlobContainers;
                var blobContainerInner           = await client.CreateAsync(this.resourceGroupName, this.accountName, this.containerName, this.cpublicAccess, this.cmetadata);

                this.SetInner(blobContainerInner);
                return(this);
            }
            else
            {
                await UpdateResourceAsync(cancellationToken);

                return(this);
            }
        }
示例#9
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations         = new Operations(this);
     Skus               = new SkusOperations(this);
     StorageAccounts    = new StorageAccountsOperations(this);
     Usages             = new UsagesOperations(this);
     ManagementPolicies = new ManagementPoliciesOperations(this);
     BlobServices       = new BlobServicesOperations(this);
     BlobContainers     = new BlobContainersOperations(this);
     BaseUri            = new System.Uri("https://management.azure.com");
     ApiVersion         = "2019-04-01";
     AcceptLanguage     = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
        protected override async Task <ImmutabilityPolicyInner> GetInnerAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            IBlobContainersOperations client = this.manager.Inner.BlobContainers;

            return(await client.GetImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName));
        }
示例#11
0
 /// <summary>
 /// Deletes specified container under its account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 public static void Delete(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName)
 {
     operations.DeleteAsync(resourceGroupName, accountName, containerName).GetAwaiter().GetResult();
 }
示例#12
0
 /// <summary>
 /// Updates container properties as specified in request body. Properties not
 /// mentioned in the request will be unchanged. Update fails if the specified
 /// container doesn't already exist.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='publicAccess'>
 /// Specifies whether data in the container may be accessed publicly and the
 /// level of access. Possible values include: 'Container', 'Blob', 'None'
 /// </param>
 /// <param name='metadata'>
 /// A name-value pair to associate with the container as metadata.
 /// </param>
 public static BlobContainer Update(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, PublicAccess?publicAccess = default(PublicAccess?), IDictionary <string, string> metadata = default(IDictionary <string, string>))
 {
     return(operations.UpdateAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the existing immutability policy along with the corresponding ETag in
 /// response headers and body.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='ifMatch'>
 /// The entity state (ETag) version of the immutability policy to update. A
 /// value of "*" can be used to apply the operation only if the immutability
 /// policy already exists. If omitted, this operation will always be applied.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ImmutabilityPolicyInner> GetImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, ifMatch, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#14
0
 /// <summary>
 /// Lists all containers and does not support a prefix like data plane. Also
 /// SRP today does not return continuation token.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 public static ListContainerItems List(this IBlobContainersOperations operations, string resourceGroupName, string accountName)
 {
     return(operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult());
 }
示例#15
0
 /// <summary>
 /// Clears legal hold tags. Clearing the same or non-existent tag results in an
 /// idempotent operation. ClearLegalHold clears out only the specified tags in
 /// the request.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='tags'>
 /// Each tag should be 3 to 23 alphanumeric characters and is normalized to
 /// lower case at SRP.
 /// </param>
 public static LegalHold ClearLegalHold(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, IList <string> tags)
 {
     return(operations.ClearLegalHoldAsync(resourceGroupName, accountName, containerName, tags).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes specified container under its account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, containerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#17
0
 /// <summary>
 /// Sets the ImmutabilityPolicy to Locked state. The only action allowed on a
 /// Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is
 /// required for this operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='ifMatch'>
 /// The entity state (ETag) version of the immutability policy to update. A
 /// value of "*" can be used to apply the operation only if the immutability
 /// policy already exists. If omitted, this operation will always be applied.
 /// </param>
 public static ImmutabilityPolicy LockImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch)
 {
     return(operations.LockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).GetAwaiter().GetResult());
 }
示例#18
0
        protected async override Task <BlobContainerInner> GetInnerAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            IBlobContainersOperations client = this.manager.Inner.BlobContainers;

            return(null); // NOP getInnerAsync implementation as get is not supported
        }
示例#19
0
 /// <summary>
 /// Extends the immutabilityPeriodSinceCreationInDays of a locked
 /// immutabilityPolicy. The only action allowed on a Locked policy will be this
 /// action. ETag in If-Match is required for this operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group within the user's subscription. The name is
 /// case insensitive.
 /// </param>
 /// <param name='accountName'>
 /// The name of the storage account within the specified resource group.
 /// Storage account names must be between 3 and 24 characters in length and use
 /// numbers and lower-case letters only.
 /// </param>
 /// <param name='containerName'>
 /// The name of the blob container within the specified storage account. Blob
 /// container names must be between 3 and 63 characters in length and use
 /// numbers, lower-case letters and dash (-) only. Every dash (-) character
 /// must be immediately preceded and followed by a letter or number.
 /// </param>
 /// <param name='ifMatch'>
 /// The entity state (ETag) version of the immutability policy to update. A
 /// value of "*" can be used to apply the operation only if the immutability
 /// policy already exists. If omitted, this operation will always be applied.
 /// </param>
 /// <param name='immutabilityPeriodSinceCreationInDays'>
 /// The immutability period for the blobs in the container since the policy
 /// creation, in days.
 /// </param>
 public static ImmutabilityPolicy ExtendImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays)
 {
     return(operations.ExtendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).GetAwaiter().GetResult());
 }