OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket.
/// (All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that 
/// you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the 
/// bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key. 
/// Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this 
/// API and there is no kmsKeyId associated with the bucket, the call will fail.
/// 
/// Calling this API starts a work request task to re-encrypt the data encryption key of all objects in the bucket. Only objects created before the time of the API call will be re-encrypted. 
/// The call can take a long time, depending on how many objects are in the bucket and how big they are. This API returns a work request ID that you can use to retrieve the status of the 
/// work request task.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket.
(All data encryption keys are encrypted by a master encryption key. Master encryption keys are assigned to buckets and managed by Oracle by default, but you can assign a key that
you created and control through the Oracle Cloud Infrastructure Key Management service.) The kmsKeyId property of the bucket determines which master encryption key is assigned to the
bucket. If you assigned a different Key Management master encryption key to the bucket, you can call this API to re-encrypt all data encryption keys with the newly assigned key.
Similarly, you might want to re-encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket. If you call this
API and there is no kmsKeyId associated with the bucket, the call will fail.

Calling this API starts a work request task to re-encrypt the data encryption key of all objects in the bucket. Only objects created before the time of the API call will be re-encrypted.
The call can take a long time, depending on how many objects are in the bucket and how big they are. This API returns a work request ID that you can use to retrieve the status of the
work request task.
Re - encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket . ( All data encryption keys are encrypted by a master encryption key . Master encryption keys are assigned to buckets and managed by Oracle by default but you can assign a key that you created and control through the Oracle Cloud Infrastructure Key Management service . ) The kmsKeyId property of the bucket determines which master encryption key is assigned to the bucket . If you assigned a different Key Management master encryption key to the bucket you can call this API to re - encrypt all data encryption keys with the newly assigned key . Similarly you might want to re - encrypt all data encryption keys if the assigned key has been rotated to a new key version since objects were last added to the bucket . If you call this API and there is no kmsKeyId associated with the bucket the call will fail . Calling this API starts a work request task to re - encrypt the data encryption key of all objects in the bucket . Only objects created before the time of the API call will be re - encrypted . The call can take a long time depending on how many objects are in the bucket and how big they are . This API returns a work request ID that you can use to retrieve the status of the work request task .
public async Task<ReencryptBucketResponse> ReencryptBucket(ReencryptBucketRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/actions/reencrypt");
            HttpRequestHeaderParam HttpRequestHeaderParam = new HttpRequestHeaderParam()
            {
                OpcClientRequestId = request.OpcClientRequestId
            };
            using (var webResponse = await this.RestClientAsync.Post(uri, null, HttpRequestHeaderParam))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new ReencryptBucketResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcWorkRequestId = webResponse.Headers.Get("opc-work-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id")
                };
            }
        }
public async Task < ReencryptBucketResponse > ReencryptBucket ( ReencryptBucketRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /actions/reencrypt " ) ; HttpRequestHeaderParam HttpRequestHeaderParam = new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ; using ( var webResponse = await this . RestClientAsync . Post ( uri , null , HttpRequestHeaderParam ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new ReencryptBucketResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcWorkRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) } ; } }
Re-encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket.
Re - encrypts the unique data encryption key that encrypts each object written to the bucket by using the most recent version of the master encryption key assigned to the bucket .
None
request
ReencryptBucketRequest
None