Documentation ¶
Overview ¶
Package tenants provides information and interaction with the tenants API resource for the OpenStack Identity service.
See http://developer.openstack.org/api-ref-identity-v2.html#identity-auth-v2 and http://developer.openstack.org/api-ref-identity-v2.html#admin-tenants for more information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, opts *ListOpts) pagination.Pager
List enumerates the Tenants to which the current token has access.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Name is the name of the tenant. Name string `json:"name" required:"true"` // Description is the description of the tenant. Description string `json:"description,omitempty"` // Enabled sets the tenant status to enabled or disabled. Enabled *bool `json:"enabled,omitempty"` }
CreateOpts represents the options needed when creating new tenant.
func (CreateOpts) ToTenantCreateMap ¶
func (opts CreateOpts) ToTenantCreateMap() (map[string]interface{}, error)
ToTenantCreateMap assembles a request body based on the contents of a CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder describes struct types that can be accepted by the Create call.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult temporarily contains the reponse from the Create call.
func Create ¶
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create is the operation responsible for creating new tenant.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult temporarily contains the response from the Delete call.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)
Delete is the operation responsible for permanently deleting an API tenant.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult temporarily contains the response from the Get call.
func Get ¶
func Get(client *gophercloud.ServiceClient, id string) (r GetResult)
Get requests details on a single tenant by ID.
type ListOpts ¶
type ListOpts struct { // Marker is the ID of the last Tenant on the previous page. Marker string `q:"marker"` // Limit specifies the page size. Limit int `q:"limit"` }
ListOpts filters the Tenants that are returned by the List call.
type Tenant ¶
type Tenant struct { // ID is a unique identifier for this tenant. ID string `json:"id"` // Name is a friendlier user-facing name for this tenant. Name string `json:"name"` // Description is a human-readable explanation of this Tenant's purpose. Description string `json:"description"` // Enabled indicates whether or not a tenant is active. Enabled bool `json:"enabled"` }
Tenant is a grouping of users in the identity service.
func ExtractTenants ¶
func ExtractTenants(r pagination.Page) ([]Tenant, error)
ExtractTenants returns a slice of Tenants contained in a single page of results.
type TenantPage ¶
type TenantPage struct {
pagination.LinkedPageBase
}
TenantPage is a single page of Tenant results.
func (TenantPage) IsEmpty ¶
func (r TenantPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a page of Tenants contains any results.
func (TenantPage) NextPageURL ¶
func (r TenantPage) NextPageURL() (string, error)
NextPageURL extracts the "next" link from the tenants_links section of the result.
type UpdateOpts ¶
type UpdateOpts struct { // Name is the name of the tenant. Name string `json:"name,omitempty"` // Description is the description of the tenant. Description string `json:"description,omitempty"` // Enabled sets the tenant status to enabled or disabled. Enabled *bool `json:"enabled,omitempty"` }
UpdateOpts specifies the base attributes that may be updated on an existing server.
func (UpdateOpts) ToTenantUpdateMap ¶
func (opts UpdateOpts) ToTenantUpdateMap() (map[string]interface{}, error)
ToTenantUpdateMap formats an UpdateOpts structure into a request body.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional attributes to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult temporarily contains the response from the Update call.
func Update ¶
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update is the operation responsible for updating exist tenants by their TenantID.