func (c context) createDBs() { opts := db.BatchCreateOpts{ db.CreateOpts{Name: "db1"}, db.CreateOpts{Name: "db2"}, db.CreateOpts{Name: "db3"}, } err := db.Create(c.client, c.instanceID, opts).ExtractErr() c.AssertNoErr(err) c.Logf("Created three databases on instance %s: db1, db2, db3", c.instanceID) }
func (c *context) createDBs() { dbs := []string{ tools.RandomString("db_", 5), tools.RandomString("db_", 5), tools.RandomString("db_", 5), } opts := db.BatchCreateOpts{ db.CreateOpts{Name: dbs[0]}, db.CreateOpts{Name: dbs[1]}, db.CreateOpts{Name: dbs[2]}, } err := db.Create(c.client, c.instanceID, opts).ExtractErr() c.Logf("Created three databases on instance %s: %s, %s, %s", c.instanceID, dbs[0], dbs[1], dbs[2]) c.AssertNoErr(err) c.DBIDs = dbs }
func Create(client *gophercloud.ServiceClient, instanceID string, opts os.CreateOptsBuilder) os.CreateResult { return os.Create(client, instanceID, opts) }