コード例 #1
0
        internal static async Task <SqlContainer> CreateSqlContainer(string name, AutoscaleSettings autoscale, SqlContainerCollection sqlContainerCollection)
        {
            SqlContainerCreateUpdateData sqlDatabaseCreateUpdateOptions = new SqlContainerCreateUpdateData(AzureLocation.WestUS,
                                                                                                           new SqlContainerResource(name)
            {
                PartitionKey = new ContainerPartitionKey(new List <string> {
                    "/address/zipCode"
                }, null, null, false)
                {
                    Kind = new PartitionKind("Hash")
                },
                IndexingPolicy = new IndexingPolicy(
                    true,
                    IndexingMode.Consistent,
                    new List <IncludedPath>
                {
                    new IncludedPath {
                        Path = "/*"
                    }
                },
                    new List <ExcludedPath>
                {
                    new ExcludedPath {
                        Path = "/pathToNotIndex/*"
                    }
                },
                    new List <IList <CompositePath> >
                {
                    new List <CompositePath>
                    {
                        new CompositePath {
                            Path = "/orderByPath1", Order = CompositePathSortOrder.Ascending
                        },
                        new CompositePath {
                            Path = "/orderByPath2", Order = CompositePathSortOrder.Descending
                        }
                    }
                },
                    new List <SpatialSpec>
                {
                    new SpatialSpec
                    (
                        "/*",
                        new List <SpatialType>
                    {
                        new SpatialType("Point")
                    }
                    ),
                }
                    )
            })
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var sqlContainerLro = await sqlContainerCollection.CreateOrUpdateAsync(WaitUntil.Completed, name, sqlDatabaseCreateUpdateOptions);

            return(sqlContainerLro.Value);
        }
コード例 #2
0
        internal static async Task <CosmosTableResource> CreateTable(string name, AutoscaleSettings autoscale, CosmosTableCollection collection)
        {
            var mongoDBDatabaseCreateUpdateOptions = new CosmosTableCreateOrUpdateContent(AzureLocation.WestUS,
                                                                                          new TableResource(name))
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var databaseLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, mongoDBDatabaseCreateUpdateOptions);

            return(databaseLro.Value);
        }
コード例 #3
0
        internal static async Task <SqlDatabase> CreateSqlDatabase(string name, AutoscaleSettings autoscale, SqlDatabaseCollection collection)
        {
            SqlDatabaseCreateUpdateData sqlDatabaseCreateUpdateOptions = new SqlDatabaseCreateUpdateData(AzureLocation.WestUS,
                                                                                                         new SqlDatabaseResource(name))
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var databaseLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, sqlDatabaseCreateUpdateOptions);

            return(databaseLro.Value);
        }
コード例 #4
0
        internal async Task <SqlStoredProcedureResource> CreateSqlStoredProcedure(AutoscaleSettings autoscale)
        {
            _storedProcedureName = Recording.GenerateAssetName("sql-stored-procedure-");
            SqlStoredProcedureCreateOrUpdateContent sqlDatabaseCreateUpdateOptions = new SqlStoredProcedureCreateOrUpdateContent(AzureLocation.WestUS,
                                                                                                                                 new Models.SqlStoredProcedureResource(_storedProcedureName)
            {
                Body = @"function () {
    var updatetext = getContext();
    var response = context.getResponse();
    response.setBody('First Hello World');
}"
            })
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var sqlContainerLro = await SqlStoredProcedureCollection.CreateOrUpdateAsync(WaitUntil.Completed, _storedProcedureName, sqlDatabaseCreateUpdateOptions);

            return(sqlContainerLro.Value);
        }
コード例 #5
0
        internal async Task <SqlTriggerResource> CreateSqlTrigger(AutoscaleSettings autoscale)
        {
            _triggerName = Recording.GenerateAssetName("sql-trigger-");
            SqlTriggerCreateUpdateData sqlDatabaseCreateUpdateOptions = new SqlTriggerCreateUpdateData(AzureLocation.WestUS,
                                                                                                       new Models.SqlTriggerResource(_triggerName)
            {
                TriggerOperation = TriggerOperation.All,
                TriggerType      = TriggerType.Pre,
                Body             = @"function () {
    var updatetext = getContext();
    var response = context.getResponse();
    response.setBody('First Hello World');
}"
            })
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var sqlContainerLro = await SqlTriggerCollection.CreateOrUpdateAsync(WaitUntil.Completed, _triggerName, sqlDatabaseCreateUpdateOptions);

            return(sqlContainerLro.Value);
        }
 internal CassandraKeyspaceGetPropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #7
0
 internal TableGetPropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #8
0
 internal CreateUpdateOptions(int?throughput, AutoscaleSettings autoscaleSettings)
 {
     Throughput        = throughput;
     AutoscaleSettings = autoscaleSettings;
 }
コード例 #9
0
        internal static async Task <MongoDBCollectionResource> CreateMongoDBCollection(string name, AutoscaleSettings autoscale, MongoDBCollectionCollection mongoDBContainerCollection)
        {
            var mongoDBDatabaseCreateUpdateOptions = new MongoDBCollectionCreateOrUpdateContent(AzureLocation.WestUS,
                                                                                                new Models.MongoDBCollectionResource(name))
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var mongoDBContainerLro = await mongoDBContainerCollection.CreateOrUpdateAsync(WaitUntil.Completed, name, mongoDBDatabaseCreateUpdateOptions);

            return(mongoDBContainerLro.Value);
        }
コード例 #10
0
 internal async Task <MongoDBCollectionResource> CreateMongoDBCollection(AutoscaleSettings autoscale)
 {
     _collectionName = Recording.GenerateAssetName("mongodb-collection-");
     return(await CreateMongoDBCollection(_collectionName, autoscale, MongoDBCollectionCollection));
 }
コード例 #11
0
 internal CassandraTablePropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #12
0
 internal SqlDatabasePropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #13
0
 internal async Task <MongoDBDatabaseResource> CreateMongoDBDatabase(AutoscaleSettings autoscale)
 {
     _databaseName = Recording.GenerateAssetName("mongodb-");
     return(await CreateMongoDBDatabase(_databaseName, autoscale, _databaseAccount.GetMongoDBDatabases()));
 }
コード例 #14
0
 internal async Task <SqlDatabase> CreateSqlDatabase(AutoscaleSettings autoscale)
 {
     _databaseName = Recording.GenerateAssetName("sql-db-");
     return(await CreateSqlDatabase(_databaseName, autoscale, _databaseAccount.GetSqlDatabases()));
 }
コード例 #15
0
 internal async Task <CosmosTableResource> CreateTable(AutoscaleSettings autoscale)
 {
     _databaseName = Recording.GenerateAssetName("table-");
     return(await CreateTable(_databaseName, autoscale, _databaseAccount.GetCosmosTables()));
 }
コード例 #16
0
 internal async Task <SqlContainerResource> CreateSqlContainer(AutoscaleSettings autoscale)
 {
     _containerName = Recording.GenerateAssetName("sql-container-");
     return(await CreateSqlContainer(_containerName, autoscale, SqlContainerCollection));
 }
コード例 #17
0
        internal static async Task <GremlinDatabaseResource> CreateGremlinDatabase(string name, AutoscaleSettings autoscale, GremlinDatabaseCollection collection)
        {
            GremlinDatabaseCreateUpdateData cassandraKeyspaceCreateUpdateOptions = new GremlinDatabaseCreateUpdateData(AzureLocation.WestUS,
                                                                                                                       new Models.GremlinDatabaseResource(name))
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var databaseLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, cassandraKeyspaceCreateUpdateOptions);

            return(databaseLro.Value);
        }
コード例 #18
0
 internal async Task <GremlinDatabaseResource> CreateGremlinDatabase(AutoscaleSettings autoscale)
 {
     _databaseName = Recording.GenerateAssetName("gremlin-db-");
     return(await CreateGremlinDatabase(_databaseName, autoscale, _databaseAccount.GetGremlinDatabases()));
 }
コード例 #19
0
 internal OptionsResource(int?throughput, AutoscaleSettings autoscaleSettings)
 {
     Throughput        = throughput;
     AutoscaleSettings = autoscaleSettings;
 }
コード例 #20
0
 internal SqlContainerGetPropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
 internal MongoDBCollectionGetPropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #22
0
 private CassandraTableCreateOrUpdateContent BuildCreateUpdateOptions(AutoscaleSettings autoscale)
 {
     _tableName = Recording.GenerateAssetName("cassandra-table-");
     return(new CassandraTableCreateOrUpdateContent(AzureLocation.WestUS,
                                                    new Models.CassandraTableResource(_tableName, default, new CassandraSchema {
コード例 #23
0
 internal GremlinGraphGetPropertiesOptions(int?throughput, AutoscaleSettings autoscaleSettings) : base(throughput, autoscaleSettings)
 {
 }
コード例 #24
0
 internal async Task <CassandraKeyspaceResource> CreateCassandraKeyspace(AutoscaleSettings autoscale)
 {
     _keyspaceName = Recording.GenerateAssetName("cassandra-keyspace-");
     return(await CreateCassandraKeyspace(_keyspaceName, autoscale, _keyspaceAccount.GetCassandraKeyspaces()));
 }