improvements on api for plugins

this change contains following changes:

1. get_labels implementation for stable plugins;
2. improvements in exposing list of plugins: now
it returns detailed info about labels also;
3. fixed minor validation issue with name parameter
of validator.
4. validations on labels on cluster creation,
cluster scaling and launching jobs.

blueprint: plugin-management-api
Change-Id: I8baf6b60f3be1c5ed81758712258b65c4d30e443
This commit is contained in:
Vitaly Gridnev 2016-07-01 17:47:50 +03:00
parent ada839c92b
commit 5e593bc8a3
1 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
from sahara.i18n import _
from sahara.plugins import provisioning as p
from sahara.plugins.vanilla import versionfactory as vhf
@ -34,6 +36,14 @@ class VanillaProvider(p.ProvisioningPluginBase):
def get_node_processes(self, hadoop_version):
return self._get_version_handler(hadoop_version).get_node_processes()
def get_labels(self):
default = {'enabled': {'status': True}, 'stable': {'status': True}}
result = {'plugin_labels': copy.deepcopy(default)}
result['version_labels'] = {
version: copy.deepcopy(default) for version in self.get_versions()
}
return result
def get_versions(self):
return self.version_factory.get_versions()