Beispiel #1
0
    def delete_resource_class(self, name):
        """Delete a custom resource class.

        :param name: The name of the resource class to be deleted.
        """
        url = '/resource_classes/%s' % (name)
        try:
            self._delete(url)
        except ks_exc.NotFound:
            raise n_exc.PlacementResourceClassNotFound(resource_class=name)
Beispiel #2
0
    def get_resource_class(self, name):
        """Show resource class.

        :param name: The name of the resource class to show
        """
        url = '/resource_classes/%s' % (name)
        try:
            return self._get(url).json()
        except ks_exc.NotFound:
            raise n_exc.PlacementResourceClassNotFound(resource_class=name)
Beispiel #3
0
    def get_resource_class(self, name):
        """Show resource class.

        :param name: The name of the resource class to show
        :raises PlacementResourceClassNotFound: If the resource class
                                                is not found.
        :returns: The name of resource class and its set of links.
        """
        url = '/resource_classes/%s' % (name)
        try:
            return self._get(url).json()
        except ks_exc.NotFound:
            raise n_exc.PlacementResourceClassNotFound(resource_class=name)
Beispiel #4
0
    def delete_resource_class(self, name):
        """Delete a custom resource class.

        :param name: The name of the resource class to be deleted.
        :raises PlacementResourceClassNotFound: If the resource class
                                                is not found.
        :returns: None.
        """
        # pylint: disable=raise-missing-from
        url = '/resource_classes/%s' % (name)
        try:
            self._delete(url)
        except ks_exc.NotFound:
            raise n_exc.PlacementResourceClassNotFound(resource_class=name)