def _cmd(self, command, data = None): """ Invokes a global command. @param command: Command name. @param data: Optional data to send to the command. @return Information about the submitted command. """ resp = self._get_resource_root().post("/cm/commands/" + command, data=data) return ApiCommand.from_json_dict(resp, self._get_resource_root())
def test_import_cluster_v12(self): resource = utils.MockResource(self, version=12) cms = ClouderaManager(resource) data = ApiClusterTemplate(resource).to_json_dict() resource.expect(method="POST", reqpath="/cm/importClusterTemplate", params=dict(addRepositories=True), data=data, retdata=ApiCommand(resource).to_json_dict()) cms.import_cluster_template(data, True)
def _cmd(self, command, data=None): """ Invokes a global command. @param command: Command name. @param data: Optional data to send to the command. @return Information about the submitted command. """ resp = self._get_resource_root().post("/cm/commands/" + command, data=data) return ApiCommand.from_json_dict(resp, self._get_resource_root())
def _cmd(self, cmd, data=None): path = self._path() + '/commands/' + cmd resp = self._get_resource_root().post(path, data=data) return ApiCommand.from_json_dict(resp, self._get_resource_root())