v2

package
v0.0.0-...-0732875 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v2 contains common functions for creating identity-based resources for use in acceptance tests. See the `*_test.go` files for example usages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserRole

func AddUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, user *users.User, role *roles.Role) error

AddUserRole will grant a role to a user in a tenant. An error will be returned if the grant was unsuccessful.

func CreateUser

func CreateUser(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant) (*users.User, error)

CreateUser will create a user with a random name and adds them to the given tenant. An error will be returned if the user was unable to be created.

func DeleteUser

func DeleteUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User)

DeleteUser will delete a user. A fatal error will occur if the delete was unsuccessful. This works best when used as a deferred function.

func DeleteUserRole

func DeleteUserRole(t *testing.T, client *gophercloud.ServiceClient, tenant *tenants.Tenant, user *users.User, role *roles.Role)

DeleteUserRole will revoke a role of a user in a tenant. A fatal error will occur if the revoke was unsuccessful. This works best when used as a deferred function.

func FindRole

func FindRole(t *testing.T, client *gophercloud.ServiceClient) (*roles.Role, error)

FindRole finds all roles that the current authenticated client has access to and returns the first one found. An error will be returned if the lookup was unsuccessful.

func FindTenant

func FindTenant(t *testing.T, client *gophercloud.ServiceClient) (*tenants.Tenant, error)

FindTenant finds all tenants that the current authenticated client has access to and returns the first one found. An error will be returned if the lookup was unsuccessful.

func PrintCatalogEntry

func PrintCatalogEntry(t *testing.T, catalogEntry *tokens.CatalogEntry)

PrintCatalogEntry will print a catalog entry and all of its attributes.

func PrintRole

func PrintRole(t *testing.T, role *roles.Role)

PrintRole will print a role and all of its attributes.

func PrintTenant

func PrintTenant(t *testing.T, tenant *tenants.Tenant)

PrintTenant will print a tenant and all of its attributes.

func PrintToken

func PrintToken(t *testing.T, token *tokens.Token)

PrintToken will print a token and all of its attributes.

func PrintTokenUser

func PrintTokenUser(t *testing.T, user *tokens.User)

PrintTokenUser will print the user information of a token and all attributes.

func PrintUser

func PrintUser(t *testing.T, user *users.User)

PrintUser will print a user and all of its attributes.

func PrintUserRole

func PrintUserRole(t *testing.T, role *users.Role)

PrintUserRole will print the roles that a user has been granted.

func UpdateUser

func UpdateUser(t *testing.T, client *gophercloud.ServiceClient, user *users.User) (*users.User, error)

UpdateUser will update an existing user with a new randomly generated name. An error will be returned if the update was unsuccessful.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL