Пример #1
0
        private void SetConsistencyPolicy(Models.DefaultConsistencyLevel level, long maxStalenessPrefix, int maxIntervalInSeconds)
        {
            var policy = new Models.ConsistencyPolicy();

            policy.DefaultConsistencyLevel = level;
            if (level == Models.DefaultConsistencyLevel.BoundedStaleness)
            {
                policy.MaxIntervalInSeconds = maxIntervalInSeconds;
                policy.MaxStalenessPrefix   = (long)maxStalenessPrefix;
            }

            this.Inner.ConsistencyPolicy = policy;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the DatabaseAccountGetResultsInner
 /// class.
 /// </summary>
 /// <param name="kind">Indicates the type of database account. This can
 /// only be set at database account creation. Possible values include:
 /// 'GlobalDocumentDB', 'MongoDB', 'Parse'</param>
 /// <param name="documentEndpoint">The connection endpoint for the
 /// Cosmos DB database account.</param>
 /// <param name="databaseAccountOfferType">The offer type for the
 /// Cosmos DB database account. Default value: Standard. Possible
 /// values include: 'Standard'</param>
 /// <param name="ipRangeFilter">Cosmos DB Firewall Support: This value
 /// specifies the set of IP addresses or IP address ranges in CIDR form
 /// to be included as the allowed list of client IPs for a given
 /// database account. IP addresses/ranges must be comma separated and
 /// must not contain any spaces.</param>
 /// <param name="isVirtualNetworkFilterEnabled">Flag to indicate
 /// whether to enable/disable Virtual Network ACL rules.</param>
 /// <param name="enableAutomaticFailover">Enables automatic failover of
 /// the write region in the rare event that the region is unavailable
 /// due to an outage. Automatic failover will result in a new write
 /// region for the account and is chosen based on the failover
 /// priorities configured for the account.</param>
 /// <param name="consistencyPolicy">The consistency policy for the
 /// Cosmos DB database account.</param>
 /// <param name="capabilities">List of Cosmos DB capabilities for the
 /// account</param>
 /// <param name="writeLocations">An array that contains the write
 /// location for the Cosmos DB account.</param>
 /// <param name="readLocations">An array that contains of the read
 /// locations enabled for the Cosmos DB account.</param>
 /// <param name="locations">An array that contains all of the locations
 /// enabled for the Cosmos DB account.</param>
 /// <param name="failoverPolicies">An array that contains the regions
 /// ordered by their failover priorities.</param>
 /// <param name="virtualNetworkRules">List of Virtual Network ACL rules
 /// configured for the Cosmos DB account.</param>
 /// <param name="enableMultipleWriteLocations">Enables the account to
 /// write in multiple locations</param>
 /// <param name="enableCassandraConnector">Enables the cassandra
 /// connector on the Cosmos DB C* account</param>
 /// <param name="connectorOffer">The cassandra connector offer type for
 /// the Cosmos DB database C* account. Possible values include:
 /// 'Small'</param>
 /// <param name="disableKeyBasedMetadataWriteAccess">Disable write
 /// operations on metadata resources (databases, containers,
 /// throughput) via account keys</param>
 /// <param name="keyVaultKeyUri">The URI of the key vault</param>
 public DatabaseAccountGetResultsInner(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), DatabaseAccountKind kind = default(DatabaseAccountKind), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType?databaseAccountOfferType = default(DatabaseAccountOfferType?), string ipRangeFilter = default(string), bool?isVirtualNetworkFilterEnabled = default(bool?), bool?enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList <Capability> capabilities = default(IList <Capability>), IList <Location> writeLocations = default(IList <Location>), IList <Location> readLocations = default(IList <Location>), IList <Location> locations = default(IList <Location>), IList <FailoverPolicy> failoverPolicies = default(IList <FailoverPolicy>), IList <VirtualNetworkRule> virtualNetworkRules = default(IList <VirtualNetworkRule>), bool?enableMultipleWriteLocations = default(bool?), bool?enableCassandraConnector = default(bool?), ConnectorOffer connectorOffer = default(ConnectorOffer), bool?disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string))
     : base(location, id, name, type, tags)
 {
     Kind = kind;
     ProvisioningState             = provisioningState;
     DocumentEndpoint              = documentEndpoint;
     DatabaseAccountOfferType      = databaseAccountOfferType;
     IpRangeFilter                 = ipRangeFilter;
     IsVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled;
     EnableAutomaticFailover       = enableAutomaticFailover;
     ConsistencyPolicy             = consistencyPolicy;
     Capabilities                       = capabilities;
     WriteLocations                     = writeLocations;
     ReadLocations                      = readLocations;
     Locations                          = locations;
     FailoverPolicies                   = failoverPolicies;
     VirtualNetworkRules                = virtualNetworkRules;
     EnableMultipleWriteLocations       = enableMultipleWriteLocations;
     EnableCassandraConnector           = enableCassandraConnector;
     ConnectorOffer                     = connectorOffer;
     DisableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess;
     KeyVaultKeyUri                     = keyVaultKeyUri;
     CustomInit();
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the DatabaseAccountInner class.
 /// </summary>
 /// <param name="kind">Indicates the type of database account. This can
 /// only be set at database account creation. Possible values include:
 /// 'GlobalDocumentDB', 'MongoDB', 'Parse'</param>
 /// <param name="documentEndpoint">The connection endpoint for the
 /// Cosmos DB database account.</param>
 /// <param name="databaseAccountOfferType">The offer type for the
 /// Cosmos DB database account. Default value: Standard. Possible
 /// values include: 'Standard'</param>
 /// <param name="ipRangeFilter">Cosmos DB Firewall Support: This value
 /// specifies the set of IP addresses or IP address ranges in CIDR form
 /// to be included as the allowed list of client IPs for a given
 /// database account. IP addresses/ranges must be comma separated and
 /// must not contain any spaces.</param>
 /// <param name="enableAutomaticFailover">Enables automatic failover of
 /// the write region in the rare event that the region is unavailable
 /// due to an outage. Automatic failover will result in a new write
 /// region for the account and is chosen based on the failover
 /// priorities configured for the account.</param>
 /// <param name="consistencyPolicy">The consistency policy for the
 /// Cosmos DB database account.</param>
 /// <param name="capabilities">List of Cosmos DB capabilities for the
 /// account</param>
 /// <param name="writeLocations">An array that contains the write
 /// location for the Cosmos DB account.</param>
 /// <param name="readLocations">An array that contains of the read
 /// locations enabled for the Cosmos DB account.</param>
 /// <param name="failoverPolicies">An array that contains the regions
 /// ordered by their failover priorities.</param>
 public DatabaseAccountInner(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string kind = default(string), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType?databaseAccountOfferType = default(DatabaseAccountOfferType?), string ipRangeFilter = default(string), bool?enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList <Capability> capabilities = default(IList <Capability>), IList <Location> writeLocations = default(IList <Location>), IList <Location> readLocations = default(IList <Location>), IList <FailoverPolicyInner> failoverPolicies = default(IList <FailoverPolicyInner>))
     : base(location, id, name, type, tags)
 {
     Kind = kind;
     ProvisioningState        = provisioningState;
     DocumentEndpoint         = documentEndpoint;
     DatabaseAccountOfferType = databaseAccountOfferType;
     IpRangeFilter            = ipRangeFilter;
     EnableAutomaticFailover  = enableAutomaticFailover;
     ConsistencyPolicy        = consistencyPolicy;
     Capabilities             = capabilities;
     WriteLocations           = writeLocations;
     ReadLocations            = readLocations;
     FailoverPolicies         = failoverPolicies;
     CustomInit();
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the
 /// DatabaseAccountCreateUpdateParametersInner class.
 /// </summary>
 /// <param name="locations">An array that contains the georeplication
 /// locations enabled for the Cosmos DB account.</param>
 /// <param name="kind">Indicates the type of database account. This can
 /// only be set at database account creation. Possible values include:
 /// 'GlobalDocumentDB', 'MongoDB', 'Parse'</param>
 /// <param name="consistencyPolicy">The consistency policy for the
 /// Cosmos DB account.</param>
 /// <param name="ipRangeFilter">Cosmos DB Firewall Support: This value
 /// specifies the set of IP addresses or IP address ranges in CIDR form
 /// to be included as the allowed list of client IPs for a given
 /// database account. IP addresses/ranges must be comma separated and
 /// must not contain any spaces.</param>
 /// <param name="isVirtualNetworkFilterEnabled">Flag to indicate
 /// whether to enable/disable Virtual Network ACL rules.</param>
 /// <param name="enableAutomaticFailover">Enables automatic failover of
 /// the write region in the rare event that the region is unavailable
 /// due to an outage. Automatic failover will result in a new write
 /// region for the account and is chosen based on the failover
 /// priorities configured for the account.</param>
 /// <param name="capabilities">List of Cosmos DB capabilities for the
 /// account</param>
 /// <param name="virtualNetworkRules">List of Virtual Network ACL rules
 /// configured for the Cosmos DB account.</param>
 public DatabaseAccountCreateUpdateParametersInner(IList <Location> locations, string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string kind = default(string), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string ipRangeFilter = default(string), bool?isVirtualNetworkFilterEnabled = default(bool?), bool?enableAutomaticFailover = default(bool?), IList <Capability> capabilities = default(IList <Capability>), IList <VirtualNetworkRule> virtualNetworkRules = default(IList <VirtualNetworkRule>))
     : base(location, id, name, type, tags)
 {
     Kind = kind;
     ConsistencyPolicy             = consistencyPolicy;
     Locations                     = locations;
     IpRangeFilter                 = ipRangeFilter;
     IsVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled;
     EnableAutomaticFailover       = enableAutomaticFailover;
     Capabilities                  = capabilities;
     VirtualNetworkRules           = virtualNetworkRules;
     CustomInit();
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the DatabaseAccountUpdateParameters
 /// class.
 /// </summary>
 /// <param name="location">The location of the resource group to which
 /// the resource belongs.</param>
 /// <param name="consistencyPolicy">The consistency policy for the
 /// Cosmos DB account.</param>
 /// <param name="locations">An array that contains the georeplication
 /// locations enabled for the Cosmos DB account.</param>
 /// <param name="ipRangeFilter">Cosmos DB Firewall Support: This value
 /// specifies the set of IP addresses or IP address ranges in CIDR form
 /// to be included as the allowed list of client IPs for a given
 /// database account. IP addresses/ranges must be comma separated and
 /// must not contain any spaces.</param>
 /// <param name="isVirtualNetworkFilterEnabled">Flag to indicate
 /// whether to enable/disable Virtual Network ACL rules.</param>
 /// <param name="enableAutomaticFailover">Enables automatic failover of
 /// the write region in the rare event that the region is unavailable
 /// due to an outage. Automatic failover will result in a new write
 /// region for the account and is chosen based on the failover
 /// priorities configured for the account.</param>
 /// <param name="capabilities">List of Cosmos DB capabilities for the
 /// account</param>
 /// <param name="virtualNetworkRules">List of Virtual Network ACL rules
 /// configured for the Cosmos DB account.</param>
 /// <param name="enableMultipleWriteLocations">Enables the account to
 /// write in multiple locations</param>
 /// <param name="enableCassandraConnector">Enables the cassandra
 /// connector on the Cosmos DB C* account</param>
 /// <param name="connectorOffer">The cassandra connector offer type for
 /// the Cosmos DB database C* account. Possible values include:
 /// 'Small'</param>
 /// <param name="disableKeyBasedMetadataWriteAccess">Disable write
 /// operations on metadata resources (databases, containers,
 /// throughput) via account keys</param>
 /// <param name="keyVaultKeyUri">The URI of the key vault</param>
 public DatabaseAccountUpdateParameters(IDictionary <string, string> tags = default(IDictionary <string, string>), string location = default(string), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList <Location> locations = default(IList <Location>), string ipRangeFilter = default(string), bool?isVirtualNetworkFilterEnabled = default(bool?), bool?enableAutomaticFailover = default(bool?), IList <Capability> capabilities = default(IList <Capability>), IList <VirtualNetworkRule> virtualNetworkRules = default(IList <VirtualNetworkRule>), bool?enableMultipleWriteLocations = default(bool?), bool?enableCassandraConnector = default(bool?), ConnectorOffer connectorOffer = default(ConnectorOffer), bool?disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string))
 {
     Tags                               = tags;
     Location                           = location;
     ConsistencyPolicy                  = consistencyPolicy;
     Locations                          = locations;
     IpRangeFilter                      = ipRangeFilter;
     IsVirtualNetworkFilterEnabled      = isVirtualNetworkFilterEnabled;
     EnableAutomaticFailover            = enableAutomaticFailover;
     Capabilities                       = capabilities;
     VirtualNetworkRules                = virtualNetworkRules;
     EnableMultipleWriteLocations       = enableMultipleWriteLocations;
     EnableCassandraConnector           = enableCassandraConnector;
     ConnectorOffer                     = connectorOffer;
     DisableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess;
     KeyVaultKeyUri                     = keyVaultKeyUri;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the
 /// DatabaseAccountCreateUpdateParameters class.
 /// </summary>
 /// <param name="locations">An array that contains the georeplication
 /// locations enabled for the Cosmos DB account.</param>
 /// <param name="kind">Indicates the type of database account. This can
 /// only be set at database account creation. Possible values include:
 /// 'GlobalDocumentDB', 'MongoDB', 'Parse'</param>
 /// <param name="consistencyPolicy">The consistency policy for the
 /// Cosmos DB account.</param>
 /// <param name="ipRangeFilter">Cosmos DB Firewall Support: This value
 /// specifies the set of IP addresses or IP address ranges in CIDR form
 /// to be included as the allowed list of client IPs for a given
 /// database account. IP addresses/ranges must be comma separated and
 /// must not contain any spaces.</param>
 /// <param name="isVirtualNetworkFilterEnabled">Flag to indicate
 /// whether to enable/disable Virtual Network ACL rules.</param>
 /// <param name="enableAutomaticFailover">Enables automatic failover of
 /// the write region in the rare event that the region is unavailable
 /// due to an outage. Automatic failover will result in a new write
 /// region for the account and is chosen based on the failover
 /// priorities configured for the account.</param>
 /// <param name="capabilities">List of Cosmos DB capabilities for the
 /// account</param>
 /// <param name="virtualNetworkRules">List of Virtual Network ACL rules
 /// configured for the Cosmos DB account.</param>
 /// <param name="enableMultipleWriteLocations">Enables the account to
 /// write in multiple locations</param>
 /// <param name="enableCassandraConnector">Enables the cassandra
 /// connector on the Cosmos DB C* account</param>
 /// <param name="connectorOffer">The cassandra connector offer type for
 /// the Cosmos DB database C* account. Possible values include:
 /// 'Small'</param>
 /// <param name="disableKeyBasedMetadataWriteAccess">Disable write
 /// operations on metadata resources (databases, containers,
 /// throughput) via account keys</param>
 public DatabaseAccountCreateUpdateParameters(string location, IList <Location> locations, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), DatabaseAccountKind kind = default(DatabaseAccountKind), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string ipRangeFilter = default(string), bool?isVirtualNetworkFilterEnabled = default(bool?), bool?enableAutomaticFailover = default(bool?), IList <Capability> capabilities = default(IList <Capability>), IList <VirtualNetworkRule> virtualNetworkRules = default(IList <VirtualNetworkRule>), bool?enableMultipleWriteLocations = default(bool?), bool?enableCassandraConnector = default(bool?), ConnectorOffer connectorOffer = default(ConnectorOffer), bool?disableKeyBasedMetadataWriteAccess = default(bool?))
     : base(location, id, name, type, tags)
 {
     Kind = kind;
     ConsistencyPolicy                  = consistencyPolicy;
     Locations                          = locations;
     IpRangeFilter                      = ipRangeFilter;
     IsVirtualNetworkFilterEnabled      = isVirtualNetworkFilterEnabled;
     EnableAutomaticFailover            = enableAutomaticFailover;
     Capabilities                       = capabilities;
     VirtualNetworkRules                = virtualNetworkRules;
     EnableMultipleWriteLocations       = enableMultipleWriteLocations;
     EnableCassandraConnector           = enableCassandraConnector;
     ConnectorOffer                     = connectorOffer;
     DisableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess;
     CustomInit();
 }