Exemplo n.º 1
0
        public RavenConfiguration()
        {
            _configBuilder = new ConfigurationBuilder();
            AddEnvironmentVariables(_configBuilder);
            AddJsonConfigurationVariables();

            Settings = _configBuilder.Build();
            Core     = new CoreConfiguration();

            Replication    = new ReplicationConfiguration();
            SqlReplication = new SqlReplicationConfiguration();
            Storage        = new StorageConfiguration();
            Encryption     = new EncryptionConfiguration();
            Indexing       = new IndexingConfiguration(() => DatabaseName, () => Core.RunInMemory, () => Core.DataDirectory);
            WebSockets     = new WebSocketsConfiguration();
            Monitoring     = new MonitoringConfiguration();
            Queries        = new QueryConfiguration();
            Patching       = new PatchingConfiguration();
            DebugLog       = new DebugLoggingConfiguration();
            BulkInsert     = new BulkInsertConfiguration();
            Server         = new ServerConfiguration();
            Memory         = new MemoryConfiguration(this);
            Expiration     = new ExpirationBundleConfiguration();
            Studio         = new StudioConfiguration();
            Databases      = new DatabaseConfiguration();
            Licensing      = new LicenseConfiguration();
            Quotas         = new QuotasBundleConfiguration();
            Tombstones     = new TombstoneConfiguration();
        }
Exemplo n.º 2
0
        public RavenConfiguration(string resourceName, ResourceType resourceType, string customConfigPath = null)
        {
            ResourceName = resourceName;
            ResourceType = resourceType;

            _configBuilder = new ConfigurationBuilder();
            AddEnvironmentVariables();
            AddJsonConfigurationVariables(customConfigPath);

            Settings = _configBuilder.Build();

            Core = new CoreConfiguration();

            Http             = new HttpConfiguration();
            Replication      = new ReplicationConfiguration();
            Cluster          = new ClusterConfiguration();
            Etl              = new EtlConfiguration();
            Storage          = new StorageConfiguration();
            Security         = new SecurityConfiguration();
            PerformanceHints = new PerformanceHintsConfiguration();
            Indexing         = new IndexingConfiguration(this);
            Monitoring       = new MonitoringConfiguration();
            Queries          = new QueryConfiguration();
            Patching         = new PatchingConfiguration();
            Logs             = new LogsConfiguration();
            Server           = new ServerConfiguration();
            Testing          = new TestingConfiguration();
            Databases        = new DatabaseConfiguration();
            Memory           = new MemoryConfiguration();
            Studio           = new StudioConfiguration();
            Licensing        = new LicenseConfiguration();
            Tombstones       = new TombstoneConfiguration();
            Subscriptions    = new SubscriptionConfiguration();
        }
        public StronglyTypedRavenSettings(NameValueCollection settings)
        {
            Replication = new ReplicationConfiguration();
            Voron       = new VoronConfiguration();
            Prefetcher  = new PrefetcherConfiguration();

            this.settings = settings;
        }
Exemplo n.º 4
0
 public PutBucketReplicationRequest(string bucket)
     : base(bucket)
 {
     this.method = CosRequestMethod.PUT;
     this.queryParameters.Add("replication", null);
     replicationConfiguration       = new ReplicationConfiguration();
     replicationConfiguration.rules = new List <ReplicationConfiguration.Rule>();
 }
		public StronglyTypedRavenSettings(NameValueCollection settings)
		{
			Replication = new ReplicationConfiguration();
			Voron = new VoronConfiguration();
			Prefetcher = new PrefetcherConfiguration();
            FileSystem = new FileSystemConfiguration();
			Encryption = new EncryptionConfiguration();
			
			this.settings = settings;
		}
        public StronglyTypedRavenSettings(NameValueCollection settings)
        {
            Replication = new ReplicationConfiguration();
            Voron       = new VoronConfiguration();
            Esent       = new EsentConfiguration();
            Prefetcher  = new PrefetcherConfiguration();
            FileSystem  = new FileSystemConfiguration();
            Encryption  = new EncryptionConfiguration();
            Indexing    = new IndexingConfiguration();

            this.settings = settings;
        }
        public StronglyTypedRavenSettings(NameValueCollection settings)
        {
            Replication = new ReplicationConfiguration();
            Voron = new VoronConfiguration();
            Esent = new EsentConfiguration();
            Prefetcher = new PrefetcherConfiguration();
            FileSystem = new FileSystemConfiguration();
            Encryption = new EncryptionConfiguration();
            Indexing = new IndexingConfiguration();
            WebSockets = new WebSocketsConfiguration();

            this.settings = settings;
        }
Exemplo n.º 8
0
        public static string BuildReplicationConfiguration(ReplicationConfiguration replicationConfiguration)
        {
            StringWriter      stringWriter     = new StringWriter();
            XmlWriterSettings xmlWriterSetting = new XmlWriterSettings();

            xmlWriterSetting.Indent = true;

            XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlWriterSetting);

            xmlWriter.WriteStartDocument();

            //start to write element
            xmlWriter.WriteStartElement("ReplicationConfiguration");

            xmlWriter.WriteElementString("Role", replicationConfiguration.role);

            if (replicationConfiguration.rules != null)
            {
                foreach (ReplicationConfiguration.Rule rule in replicationConfiguration.rules)
                {
                    if (rule == null)
                    {
                        continue;
                    }

                    xmlWriter.WriteStartElement("Rule");

                    xmlWriter.WriteElementString("Status", rule.status);
                    xmlWriter.WriteElementString("ID", rule.id);
                    xmlWriter.WriteElementString("Prefix", rule.prefix);
                    if (rule.destination != null)
                    {
                        xmlWriter.WriteStartElement("Destination");
                        xmlWriter.WriteElementString("Bucket", rule.destination.bucket);
                        if (rule.destination.storageClass != null)
                        {
                            xmlWriter.WriteElementString("StorageClass", rule.destination.storageClass);
                        }
                        xmlWriter.WriteEndElement();
                    }
                    xmlWriter.WriteEndElement();
                }
            }

            // end to element
            xmlWriter.WriteEndElement();

            xmlWriter.WriteEndDocument();
            xmlWriter.Flush();
            return(RemoveXMLHeader(stringWriter.ToString()));
        }
 internal GetBucketReplicationResponse(HttpStatusCode statusCode, string responseContent)
     : base(statusCode, responseContent)
 {
     if (string.IsNullOrEmpty(responseContent) ||
         !HttpStatusCode.OK.Equals(statusCode))
     {
         this.Config = null;
         return;
     }
     using (var stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseContent)))
     {
         this.Config = (ReplicationConfiguration) new XmlSerializer(typeof(ReplicationConfiguration)).Deserialize(stream);
     }
 }
Exemplo n.º 10
0
        private RavenConfiguration(string resourceName, ResourceType resourceType, string customConfigPath = null, bool skipEnvironmentVariables = false)
        {
            _logger = LoggingSource.Instance.GetLogger <RavenConfiguration>(resourceName);

            ResourceName      = resourceName;
            ResourceType      = resourceType;
            _customConfigPath = customConfigPath;
            PathSettingBase <string> .ValidatePath(_customConfigPath);

            _configBuilder = new ConfigurationBuilder();
            if (skipEnvironmentVariables == false)
            {
                AddEnvironmentVariables();
            }
            AddJsonConfigurationVariables(customConfigPath);

            Settings = _configBuilder.Build();

            Core = new CoreConfiguration();

            Http             = new HttpConfiguration();
            Replication      = new ReplicationConfiguration();
            Cluster          = new ClusterConfiguration();
            Etl              = new EtlConfiguration();
            Storage          = new StorageConfiguration();
            Security         = new SecurityConfiguration();
            Backup           = new BackupConfiguration();
            PerformanceHints = new PerformanceHintsConfiguration();
            Indexing         = new IndexingConfiguration(this);
            Monitoring       = new MonitoringConfiguration();
            Queries          = new QueryConfiguration();
            Patching         = new PatchingConfiguration();
            Logs             = new LogsConfiguration();
            Server           = new ServerConfiguration();
            Embedded         = new EmbeddedConfiguration();
            Databases        = new DatabaseConfiguration(Storage.ForceUsing32BitsPager);
            Memory           = new MemoryConfiguration();
            Studio           = new StudioConfiguration();
            Licensing        = new LicenseConfiguration();
            Tombstones       = new TombstoneConfiguration();
            Subscriptions    = new SubscriptionsConfiguration();
            TransactionMergerConfiguration = new TransactionMergerConfiguration(Storage.ForceUsing32BitsPager);
            Notifications = new NotificationsConfiguration();
            Updates       = new UpdatesConfiguration();
            Migration     = new MigrationConfiguration();
            Integrations  = new IntegrationsConfiguration();
        }
Exemplo n.º 11
0
        public StronglyTypedRavenSettings(NameValueCollection settings)
        {
            Replication = new ReplicationConfiguration();
            Voron       = new VoronConfiguration();
            Esent       = new EsentConfiguration();
            Prefetcher  = new PrefetcherConfiguration();
            FileSystem  = new FileSystemConfiguration();
            Counter     = new CounterConfiguration();
            TimeSeries  = new TimeSeriesConfiguration();
            Encryption  = new EncryptionConfiguration();
            Indexing    = new IndexingConfiguration();
            WebSockets  = new WebSocketsConfiguration();
            Cluster     = new ClusterConfiguration();
            Monitoring  = new MonitoringConfiguration();
            Studio      = new StudioConfiguration();

            this.settings = settings;
        }
Exemplo n.º 12
0
        // Set Replication configuration for the bucket
        public async static Task Run(MinioClient minio,
                                     string bucketName = "my-bucket-name")
        {
            try
            {
                Console.WriteLine("Running example for API: SetBucketReplication");
                Dictionary <string, string> tags = new Dictionary <string, string>()
                {
                    { "key1", "value1" },
                    { "key2", "value2" },
                    { "key3", "value3" }
                };
                ReplicationRule rule =
                    new ReplicationRule(
                        new DeleteMarkerReplication(DeleteMarkerReplication.StatusEnabled),
                        new ReplicationDestination(
                            null, null, "Bucket-ARN", null, null, null, null),
                        null,
                        new RuleFilter(new AndOperator("PREFIX", Tagging.GetBucketTags(tags)), null, null),
                        new DeleteReplication(DeleteReplication.StatusDisabled),
                        1,
                        "REPLICATION-ID",
                        "PREFIX",
                        null,
                        ReplicationRule.StatusEnabled
                        );
                List <ReplicationRule> rules = new List <ReplicationRule>();
                rules.Add(rule);
                ReplicationConfiguration repl = new ReplicationConfiguration("REPLICATION-ROLE", rules);

                await minio.SetBucketReplicationAsync(
                    new SetBucketReplicationArgs()
                    .WithBucket(bucketName)
                    .WithConfiguration(repl)
                    );

                Console.WriteLine($"Bucket Replication set for bucket {bucketName}.");
                Console.WriteLine();
            }
            catch (Exception e)
            {
                Console.WriteLine($"[Bucket]  Exception: {e}");
            }
        }
Exemplo n.º 13
0
        public InMemoryRavenConfiguration()
        {
            Replication = new ReplicationConfiguration();
            Prefetcher  = new PrefetcherConfiguration();
            Storage     = new StorageConfiguration();

            Settings = new NameValueCollection(StringComparer.OrdinalIgnoreCase);

            CreateAutoIndexesForAdHocQueriesIfNeeded = true;

            CreatePluginsDirectoryIfNotExisting   = true;
            CreateAnalyzersDirectoryIfNotExisting = true;


            IndexingScheduler = new FairIndexingSchedulerWithNewIndexesBias();

            Catalog = new AggregateCatalog(new AssemblyCatalog(typeof(DocumentDatabase).Assembly));

            Catalog.Changed += (sender, args) => ResetContainer();
        }
Exemplo n.º 14
0
        public void getBucketReplication()
        {
            //.cssg-snippet-body-start:[get-bucket-replication]
            CosXmlConfig config = new CosXmlConfig.Builder()
                                  .SetConnectionTimeoutMs(60000) //设置连接超时时间,单位毫秒,默认45000ms
                                  .SetReadWriteTimeoutMs(40000)  //设置读写超时时间,单位毫秒,默认45000ms
                                  .IsHttps(true)                 //设置默认 HTTPS 请求
                                  .SetAppid("1253653367")        //设置腾讯云账户的账户标识 APPID
                                  .SetRegion("ap-guangzhou")     //设置一个默认的存储桶地域
                                  .Build();

            string secretId       = Environment.GetEnvironmentVariable("COS_KEY");    //云 API 密钥 SecretId
            string secretKey      = Environment.GetEnvironmentVariable("COS_SECRET"); //云 API 密钥 SecretKey
            long   durationSecond = 600;                                              //每次请求签名有效时长,单位为秒
            QCloudCredentialProvider qCloudCredentialProvider = new DefaultQCloudCredentialProvider(secretId,
                                                                                                    secretKey, durationSecond);

            CosXml cosXml = new CosXmlServer(config, qCloudCredentialProvider);

            string bucket = "bucket-cssg-test-dotnet-1253653367"; //格式:BucketName-APPID
            GetBucketReplicationRequest request = new GetBucketReplicationRequest(bucket);

            //使用同步方法
            try
            {
                GetBucketReplicationResult result = cosXml.GetBucketReplication(request);
                // 存储桶的跨区域复制配置
                ReplicationConfiguration conf = result.replicationConfiguration;
            }
            catch (COSXML.CosException.CosClientException clientEx)
            {
                Console.WriteLine("CosClientException: " + clientEx);
                Assert.Null(clientEx);
            }
            catch (COSXML.CosException.CosServerException serverEx)
            {
                Console.WriteLine("CosServerException: " + serverEx.GetInfo());
                Assert.Null(serverEx);
            }
            //.cssg-snippet-body-end
        }
        static async Task EnableReplicationAsync()
        {
            try
            {
                ReplicationConfiguration replConfig = new ReplicationConfiguration
                {
                    Role  = roleArn,
                    Rules =
                    {
                        new ReplicationRule
                        {
                            Prefix      = "Tax",
                            Status      = ReplicationRuleStatus.Enabled,
                            Destination = new ReplicationDestination
                            {
                                BucketArn = destinationBucketArn
                            }
                        }
                    }
                };

                PutBucketReplicationRequest putRequest = new PutBucketReplicationRequest
                {
                    BucketName    = sourceBucket,
                    Configuration = replConfig
                };

                PutBucketReplicationResponse putResponse = await s3Client.PutBucketReplicationAsync(putRequest);

                // Verify configuration by retrieving it.
                await RetrieveReplicationConfigurationAsync(s3Client);
            }
            catch (AmazonS3Exception e)
            {
                Console.WriteLine("Error encountered on server. Message:'{0}' when writing an object", e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine("Unknown encountered on server. Message:'{0}' when writing an object", e.Message);
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// This method adds replication rules to the Amazon S3 source bucket.
        /// </summary>
        /// <param name="client">The initialized Amazon S3 client object used to
        /// create and add the replication configuration to the source bucket.</param>
        /// <param name="sourceBucket">A string representing the name of the
        /// source Amazon S3 bucket.</param>
        /// <param name="destinationBucketArn">The ARN of the destination Amazon
        /// S3 bucket.</param>
        /// <param name="roleArn">The ARN of the role which will be used to
        /// replicate the contents of the source Amazon S3 bucket.</param>
        public static async Task EnableReplicationAsync(
            IAmazonS3 client,
            string sourceBucket,
            string destinationBucketArn,
            string roleArn)
        {
            try
            {
                var replConfig = new ReplicationConfiguration
                {
                    Role  = roleArn,
                    Rules =
                    {
                        new ReplicationRule
                        {
                            Filter = new ReplicationRuleFilter{
                                Prefix = "Tax"
                            },
                            Status      = ReplicationRuleStatus.Enabled,
                            Destination = new ReplicationDestination
                            {
                                BucketArn = destinationBucketArn,
                            },
                        },
                    },
                };

                var request = new PutBucketReplicationRequest
                {
                    BucketName    = sourceBucket,
                    Configuration = replConfig,
                };

                var response = await client.PutBucketReplicationAsync(request);
            }
            catch (AmazonS3Exception ex)
            {
                Console.WriteLine($"Error: {ex.Message}");
            }
        }
Exemplo n.º 17
0
        /// 获取存储桶跨地域复制规则
        public void GetBucketReplication()
        {
            //.cssg-snippet-body-start:[get-bucket-replication]
            string bucket = "examplebucket-1250000000"; //格式:BucketName-APPID
            GetBucketReplicationRequest request = new GetBucketReplicationRequest(bucket);

            try
            {
                GetBucketReplicationResult result = cosXml.GetBucketReplication(request);
                // 存储桶的跨区域复制配置
                ReplicationConfiguration conf = result.replicationConfiguration;
            }
            catch (COSXML.CosException.CosClientException clientEx)
            {
                Console.WriteLine("CosClientException: " + clientEx);
            }
            catch (COSXML.CosException.CosServerException serverEx)
            {
                Console.WriteLine("CosServerException: " + serverEx.GetInfo());
            }

            //.cssg-snippet-body-end
        }
Exemplo n.º 18
0
        public RavenConfiguration()
        {
            Settings = new NameValueCollection(StringComparer.OrdinalIgnoreCase);

            Core = new CoreConfiguration(this);

            FileSystem = new FileSystemConfiguration(Core);
            Counter    = new CounterConfiguration(Core);
            TimeSeries = new TimeSeriesConfiguration(Core);

            Replication = new ReplicationConfiguration();
            Prefetcher  = new PrefetcherConfiguration();
            Storage     = new StorageConfiguration();
            Encryption  = new EncryptionConfiguration();
            Indexing    = new IndexingConfiguration();
            WebSockets  = new WebSocketsConfiguration();
            Cluster     = new ClusterConfiguration();
            Monitoring  = new MonitoringConfiguration();
            Queries     = new QueryConfiguration();
            Patching    = new PatchingConfiguration();
            BulkInsert  = new BulkInsertConfiguration();
            Server      = new ServerConfiguration();
            Memory      = new MemoryConfiguration();
            Expiration  = new ExpirationBundleConfiguration();
            Versioning  = new VersioningBundleConfiguration();
            Studio      = new StudioConfiguration();
            Tenants     = new TenantConfiguration();
            Licensing   = new LicenseConfiguration();
            Quotas      = new QuotasBundleConfiguration();

            IndexingClassifier = new DefaultIndexingClassifier();

            Catalog = new AggregateCatalog(CurrentAssemblyCatalog);

            Catalog.Changed += (sender, args) => ResetContainer();
        }
		public IRequest Marshall(PutBucketReplicationRequest putBucketreplicationRequest)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			IRequest val = new DefaultRequest(putBucketreplicationRequest, "AmazonS3");
			val.set_HttpMethod("PUT");
			val.set_ResourcePath("/" + S3Transforms.ToStringValue(putBucketreplicationRequest.BucketName));
			val.AddSubResource("replication");
			StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
			using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings
			{
				Encoding = Encoding.UTF8,
				OmitXmlDeclaration = true
			}))
			{
				ReplicationConfiguration configuration = putBucketreplicationRequest.Configuration;
				if (configuration != null)
				{
					xmlWriter.WriteStartElement("ReplicationConfiguration", "");
					if (configuration.Role != null)
					{
						xmlWriter.WriteElementString("Role", "", S3Transforms.ToXmlStringValue(configuration.Role));
					}
					if (configuration.Rules != null)
					{
						foreach (ReplicationRule rule in configuration.Rules)
						{
							xmlWriter.WriteStartElement("Rule");
							if (rule.IsSetId())
							{
								xmlWriter.WriteElementString("ID", "", S3Transforms.ToXmlStringValue(rule.Id));
							}
							if (rule.IsSetPrefix())
							{
								xmlWriter.WriteElementString("Prefix", "", S3Transforms.ToXmlStringValue(rule.Prefix));
							}
							else
							{
								xmlWriter.WriteElementString("Prefix", "", S3Transforms.ToXmlStringValue(""));
							}
							if (rule.IsSetStatus())
							{
								xmlWriter.WriteElementString("Status", "", S3Transforms.ToXmlStringValue(((object)rule.Status).ToString()));
							}
							if (rule.IsSetDestination())
							{
								xmlWriter.WriteStartElement("Destination", "");
								if (rule.Destination.IsSetBucketArn())
								{
									xmlWriter.WriteElementString("Bucket", "", rule.Destination.BucketArn);
								}
								if (rule.Destination.IsSetStorageClass())
								{
									xmlWriter.WriteElementString("StorageClass", "", ConstantClass.op_Implicit(rule.Destination.StorageClass));
								}
								xmlWriter.WriteEndElement();
							}
							xmlWriter.WriteEndElement();
						}
					}
					xmlWriter.WriteEndElement();
				}
			}
			try
			{
				string text = stringWriter.ToString();
				val.set_Content(Encoding.UTF8.GetBytes(text));
				val.get_Headers()["Content-Type"] = "application/xml";
				string value = AmazonS3Util.GenerateChecksumForContent(text, fBase64Encode: true);
				val.get_Headers()["Content-MD5"] = value;
				return val;
			}
			catch (EncoderFallbackException ex)
			{
				throw new AmazonServiceException("Unable to marshall request to XML", (Exception)ex);
			}
		}
Exemplo n.º 20
0
        // Set Replication configuration for the bucket
        public async static Task Run(MinioClient minio,
                                     string bucketName       = "my-bucket-name",
                                     string destBucketName   = "dest-bucket-name",
                                     string replicationCfgID = "my-replication-ID")
        {
            var setArgs = new SetVersioningArgs()
                          .WithBucket(bucketName)
                          .WithVersioningEnabled();
            await minio.SetVersioningAsync(setArgs);

            setArgs = new SetVersioningArgs()
                      .WithBucket(destBucketName)
                      .WithVersioningEnabled();
            await minio.SetVersioningAsync(setArgs);

            string serverEndPoint = "";
            string schema         = "http://";
            string accessKey      = "";
            string secretKey      = "";

            if (Environment.GetEnvironmentVariable("SERVER_ENDPOINT") != null)
            {
                serverEndPoint = Environment.GetEnvironmentVariable("SERVER_ENDPOINT");
                accessKey      = Environment.GetEnvironmentVariable("ACCESS_KEY");
                secretKey      = Environment.GetEnvironmentVariable("SECRET_KEY");
                if (Environment.GetEnvironmentVariable("ENABLE_HTTPS") != null)
                {
                    if (Environment.GetEnvironmentVariable("ENABLE_HTTPS").Equals("1"))
                    {
                        schema = "https://";
                    }
                }
            }
            else
            {
                serverEndPoint = "play.min.io";
                accessKey      = "Q3AM3UQ867SPQQA43P2F";
                secretKey      = "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG";
                schema         = "http://";
            }

            var cmdFullPathMC = Bash("which mc").TrimEnd('\r', '\n', ' ');
            var cmdAlias      = cmdFullPathMC + " alias list | egrep -B1 \"" +
                                schema + serverEndPoint + "\" | grep -v URL";
            var alias = Bash(cmdAlias).TrimEnd('\r', '\n', ' ');

            var cmdRemoteAdd = cmdFullPathMC + " admin bucket remote add " +
                               alias + "/" + bucketName + "/ " + schema +
                               accessKey + ":" + secretKey + "@" +
                               serverEndPoint + "/" + destBucketName +
                               " --service replication --region us-east-1";

            var arn = Bash(cmdRemoteAdd).Replace("Remote ARN = `", "").Replace("`.", "");

            ReplicationRule rule =
                new ReplicationRule(
                    new DeleteMarkerReplication(DeleteMarkerReplication.StatusDisabled),
                    new ReplicationDestination(null, null,
                                               "arn:aws:s3:::" + destBucketName,
                                               null, null, null, null),
                    new ExistingObjectReplication(ExistingObjectReplication.StatusEnabled),
                    new RuleFilter(null, null, null),
                    new DeleteReplication(DeleteReplication.StatusDisabled),
                    1,
                    replicationCfgID,
                    "",
                    new SourceSelectionCriteria(new SseKmsEncryptedObjects(
                                                    SseKmsEncryptedObjects.StatusEnabled)),
                    ReplicationRule.StatusEnabled
                    );
            List <ReplicationRule> rules = new List <ReplicationRule>();

            rules.Add(rule);
            ReplicationConfiguration repl = new ReplicationConfiguration(arn, rules);

            await minio.SetBucketReplicationAsync(
                new SetBucketReplicationArgs()
                .WithBucket(bucketName)
                .WithConfiguration(repl)
                );
        }
Exemplo n.º 21
0
 public void CreateConfigurationCluster(ConfigServerConfiguration serverConfig, int heartBeat, ReplicationConfiguration replConfig, string displayName)
 {
     _session.CreateConfigurationCluster(serverConfig, heartBeat, replConfig, displayName);
 }
 internal override void ParseResponseBody(System.IO.Stream inputStream, string contentType, long contentLength)
 {
     replicationConfiguration = new ReplicationConfiguration();
     XmlParse.ParseReplicationConfiguration(inputStream, replicationConfiguration);
 }
 public SetBucketReplicationArgs WithConfiguration(ReplicationConfiguration conf)
 {
     BucketReplication = conf;
     return(this);
 }