예제 #1
0
파일: cms.py 프로젝트: axemblr/cm_api
  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())
예제 #2
0
 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)
예제 #3
0
    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())
예제 #4
0
 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())
예제 #5
0
파일: clusters.py 프로젝트: corersky/cm_api
 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())