Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright 2011 OpenStack LLC. # Copyright 2011 Nebula, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
"""Represents a Keystone tenant
Attributes: * id: a uuid that identifies the tenant * name: tenant name * description: tenant description * enabled: boolean to indicate if tenant is enabled
""" return "<Tenant %s>" % self._info
return self.manager.delete(self)
# Preserve the existing settings; keystone legacy resets these? else: new_description = self.description
description=new_description, enabled=new_enabled) except Exception: retval = None
base.getid(role), self.id)
base.getid(role), self.id)
return self.manager.list_users(self.id)
"""Manager class for manipulating Keystone tenants"""
""" Create a new tenant.
""" "description": description, "enabled": enabled}}
""" Get a list of tenants.
:param integer limit: maximum number to return. (optional) :param string marker: use when specifying a limit and making multiple calls for querying. (optional)
:rtype: list of :class:`Tenant`
"""
# special casing to allow tenant lists on the auth_url # for unscoped tokens
enabled=None): """ Update a tenant with a new name and description. """ # Keystone's API uses a POST rather than a PUT here.
""" Delete a tenant. """
""" List users for a tenant. """ return self.api.users.list(base.getid(tenant))
""" Add a user to a tenant with the given role. """ base.getid(role), base.getid(tenant))
""" Remove the specified role from the user on the tenant. """ base.getid(role), base.getid(tenant)) |