Example #1
0
func createUser(t *testing.T, client *gophercloud.ServiceClient, tenantID string) string {
	t.Log("Creating user")

	opts := users.CreateOpts{
		Name:     tools.RandomString("user_", 5),
		Enabled:  users.Disabled,
		TenantID: tenantID,
		Email:    "*****@*****.**",
	}

	user, err := users.Create(client, opts).Extract()
	th.AssertNoErr(t, err)
	t.Logf("Created user %s on tenant %s", user.ID, tenantID)

	return user.ID
}
Example #2
0
// Create is the operation responsible for creating new users.
func Create(client *gophercloud.ServiceClient, opts os.CreateOptsBuilder) CreateResult {
	return CreateResult{os.Create(client, opts)}
}