2 Package tenants provides information and interaction with the
3 tenants API resource for the OpenStack Identity service.
5 See http://developer.openstack.org/api-ref-identity-v2.html#identity-auth-v2
6 and http://developer.openstack.org/api-ref-identity-v2.html#admin-tenants
9 Example to List Tenants
11 listOpts := tenants.ListOpts{
15 allPages, err := tenants.List(identityClient, listOpts).AllPages()
20 allTenants, err := tenants.ExtractTenants(allPages)
25 for _, tenant := range allTenants {
26 fmt.Printf("%+v\n", tenant)
29 Example to Create a Tenant
31 createOpts := tenants.CreateOpts{
33 Description: "this is a tenant",
34 Enabled: gophercloud.Enabled,
37 tenant, err := tenants.Create(identityClient, createOpts).Extract()
42 Example to Update a Tenant
44 tenantID := "e6db6ed6277c461a853458589063b295"
46 updateOpts := tenants.UpdateOpts{
47 Description: "this is a new description",
48 Enabled: gophercloud.Disabled,
51 tenant, err := tenants.Update(identityClient, tenantID, updateOpts).Extract()
56 Example to Delete a Tenant
58 tenantID := "e6db6ed6277c461a853458589063b295"
60 err := tenants.Delete(identitYClient, tenantID).ExtractErr()