HPC 2016.1 REST API Documentation RRS feed

  • Question

  • Is there any documentation for the new JSON REST api?

    Specifically, I'm trying to figure out the correct way to post data to create a new job.

    Using the obvious dict of properties - e.g.

    data = {'Name': 'TestJob'}

    ...doesn't work. The job is created but it doesn't have the specified name TestJob - the Job Name field is blank.

    Whats' the correct way to pass properties to the new JSON REST api?



    Monday, January 22, 2018 12:48 AM

All replies

  • Are there any logs for the web api where I might find out what is going wrong? If so, where would I find them?



    Monday, January 22, 2018 1:48 AM
  • Also, what's the correct api version to be using for HPC Pack 2016 Update 1?
    I'm currently using the below which I found in the "New Set of HPC Pack Scheduler REST API" pdf

    headers={"api-version": "2016-11-01.5.0"}

    Monday, January 22, 2018 2:03 AM
  • Through a process of trial-and-error I've found the correct format of the JSON properties to be below:
    kwargs = dict(
        headers={"api-version": "2016-11-01.5.0"},
    properties = [
        {'Name': 'Name', 'Value': 'PythonTest'}
    url = f"https://{os.environ['CCP_SCHEDULER']}/hpc/jobs"
    resp = requests.post(url, json=properties, **kwargs)
    job_id = resp.json()

    Even some basic/unfinished/dev documentation would be helpful!
    Monday, January 22, 2018 2:40 AM
  • Hi,

      We understand the poor documentation. And this is one of the top thing we are tackling within the next several months.

    Qiufang Shi

    Monday, January 22, 2018 9:43 AM