Rest Api

REST API for the GMan micro service defined by openapi.yml

POST /task

Creates a new task

Example request:

POST /task HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "run_id": "string",
    "project": "string",
    "caller": "string",
    "parent_id": "string",
    "thread_id": "string",
    "message": "string",
    "status": "started"
}
Status Codes
  • 200 OK

    New created task event

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "event_id": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        },
        "timestamp": "2019-10-24T18:36:58.914878",
        "status": "completed",
        "message": "string",
        "artifact": {
            "type": "log",
            "sri": "string",
            "status": "unique",
            "event_id": "string",
            "artifact_id": "string",
            "uri": "string",
            "task": {
                "task_id": "string",
                "run_id": "string",
                "project": "string",
                "caller": "string",
                "parent_id": "string",
                "thread_id": "string"
            }
        },
        "return_code": 1
    }
    

  • 422 Unprocessable Entity – Input Error

  • 500 Internal Server Error – Internal Server Error

PUT /task/{task_id}

Create a new TaskEvent for a Task

Parameters
  • task_id (string) – task id for a created task

Example request:

PUT /task/{task_id} HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "task_id": "string",
    "status": "completed",
    "message": "string",
    "artifact": "string",
    "return_code": 1
}
Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "event_id": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        },
        "timestamp": "2019-10-24T18:36:58.914878",
        "status": "completed",
        "message": "string",
        "artifact": {
            "type": "log",
            "sri": "string",
            "status": "unique",
            "event_id": "string",
            "artifact_id": "string",
            "uri": "string",
            "task": {
                "task_id": "string",
                "run_id": "string",
                "project": "string",
                "caller": "string",
                "parent_id": "string",
                "thread_id": "string"
            }
        },
        "return_code": 1
    }
    

  • 404 Not Found – Not Found Error

  • 422 Unprocessable Entity – Input Error

  • 500 Internal Server Error – Internal Server Error

HEAD /task/{task_id}

Return a header for a task

Parameters
  • task_id (string) – task id for a created task

Status Codes
GET /task/{task_id}

Return a task

Parameters
  • task_id (string) – task id for a created task

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "task_id": "string",
        "run_id": "string",
        "project": "string",
        "caller": "string",
        "parent_id": "string",
        "thread_id": "string"
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /task/{task_id}/events

Returns a header for a task’s events

Parameters
  • task_id (string) – task id for a created task

Status Codes
GET /task/{task_id}/events

Returns one to many task events

Parameters
  • task_id (string) – task id for a created task

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "event_id": "string",
            "task": {
                "task_id": "string",
                "run_id": "string",
                "project": "string",
                "caller": "string",
                "parent_id": "string",
                "thread_id": "string"
            },
            "timestamp": "2019-10-24T18:36:58.914878",
            "status": "completed",
            "message": "string",
            "artifact": {
                "type": "log",
                "sri": "string",
                "status": "unique",
                "event_id": "string",
                "artifact_id": "string",
                "uri": "string",
                "task": {
                    "task_id": "string",
                    "run_id": "string",
                    "project": "string",
                    "caller": "string",
                    "parent_id": "string",
                    "thread_id": "string"
                }
            },
            "return_code": 1
        }
    ]
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /run/{run_id}

Returns a task header by run id

Parameters
  • run_id (string) – run id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "x-gman-tasks-running": 1,
        "x-gman-tasks-completed": 1,
        "x-gman-tasks-pending": 1,
        "x-gman-tasks-failed": 1
    }
    

  • 400 Bad Request – Bad Request

  • 404 Not Found – Zero Results

  • 500 Internal Server Error – Internal Server Error

GET /run/{run_id}

Returns one to many tasks by run id

Parameters
  • run_id (string) – run id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    ]
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /run/{run_id}/events

Returns a task events header by run id

Parameters
  • run_id (string) – run id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "x-gman-tasks-running": 1,
        "x-gman-tasks-completed": 1,
        "x-gman-tasks-pending": 1,
        "x-gman-tasks-failed": 1
    }
    

  • 400 Bad Request – Bad Request

  • 404 Not Found – Zero Results

  • 500 Internal Server Error – Internal Server Error

GET /run/{run_id}/events

Retruns one to many task events by run id

Parameters
  • run_id (string) – run id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "event_id": "string",
            "task": {
                "task_id": "string",
                "run_id": "string",
                "project": "string",
                "caller": "string",
                "parent_id": "string",
                "thread_id": "string"
            },
            "timestamp": "2019-10-24T18:36:58.914878",
            "status": "completed",
            "message": "string",
            "artifact": {
                "type": "log",
                "sri": "string",
                "status": "unique",
                "event_id": "string",
                "artifact_id": "string",
                "uri": "string",
                "task": {
                    "task_id": "string",
                    "run_id": "string",
                    "project": "string",
                    "caller": "string",
                    "parent_id": "string",
                    "thread_id": "string"
                }
            },
            "return_code": 1
        }
    ]
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /thread/{thread_id}

Returns a thread’s header

Parameters
  • thread_id (string) – thread id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "x-gman-tasks-running": 1,
        "x-gman-tasks-completed": 1,
        "x-gman-tasks-pending": 1,
        "x-gman-tasks-failed": 1
    }
    

  • 400 Bad Request – Bad Request

  • 404 Not Found – Zero Results

  • 500 Internal Server Error – Internal Server Error

GET /thread/{thread_id}

Returns a thread of one to many tasks

Parameters
  • thread_id (string) – thread id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    ]
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /thread/{thread_id}/events

Returns a event’s header

Parameters
  • thread_id (string) – thread id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "x-gman-tasks-running": 1,
        "x-gman-tasks-completed": 1,
        "x-gman-tasks-pending": 1,
        "x-gman-tasks-failed": 1
    }
    

  • 400 Bad Request – Bad Request

  • 404 Not Found – Zero Results

  • 500 Internal Server Error – Internal Server Error

GET /thread/{thread_id}/events

Return a thread of one to many task events

Parameters
  • thread_id (string) – thread id for a created task or thread

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "event_id": "string",
            "task": {
                "task_id": "string",
                "run_id": "string",
                "project": "string",
                "caller": "string",
                "parent_id": "string",
                "thread_id": "string"
            },
            "timestamp": "2019-10-24T18:36:58.914878",
            "status": "completed",
            "message": "string",
            "artifact": {
                "type": "log",
                "sri": "string",
                "status": "unique",
                "event_id": "string",
                "artifact_id": "string",
                "uri": "string",
                "task": {
                    "task_id": "string",
                    "run_id": "string",
                    "project": "string",
                    "caller": "string",
                    "parent_id": "string",
                    "thread_id": "string"
                }
            },
            "return_code": 1
        }
    ]
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

POST /artifact

Creates a new artifact

Example request:

POST /artifact HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "type": "log",
    "task_id": "string",
    "sri": "string",
    "uri": "string"
}
Status Codes
  • 200 OK

    New created artifact

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 422 Unprocessable Entity – Input Error

  • 500 Internal Server Error – Internal Server Error

HEAD /artifact/{artifact}

Return an artifact header

Parameters
  • artifact (string) – artifact id for a created artifact

Status Codes
GET /artifact/{artifact}

Return an artifact

Parameters
  • artifact (string) – artifact id for a created artifact

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /artifact/{task_id}

Return an artifact header by task id

Parameters
  • task_id (string) – task id for a created artifact

Query Parameters
  • filter (array) –

Status Codes
GET /artifact/{task_id}

Return an artifact by task id

Parameters
  • task_id (string) – task id for a created artifact

Query Parameters
  • filter (array) –

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /artifact/{sri}

Return an artifact header by SRI

Parameters
  • sri (string) – sri hash for a created artifact

Status Codes
GET /artifact/{sri}

Return an artifact by SRI

Parameters
  • sri (string) – sri hash for a created artifact

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /artifact/thread/{thread_id}

Return an artifact header by thread id

Parameters
  • thread_id (string) – thread id for a task

Query Parameters
  • filter (array) –

Status Codes
GET /artifact/thread/{thread_id}

Return an artifact by thread id

Parameters
  • thread_id (string) – thread id for a task

Query Parameters
  • filter (array) –

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error

HEAD /artifact/run/{run_id}

Return an artifact header by run id

Parameters
  • run_id (string) – run id for a task

Query Parameters
  • filter (array) –

Status Codes
GET /artifact/run/{run_id}

Return an artifact by run id

Parameters
  • run_id (string) – run id for a task

Query Parameters
  • filter (array) –

Status Codes
  • 200 OK

    Object to be returned

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "type": "log",
        "sri": "string",
        "status": "unique",
        "event_id": "string",
        "artifact_id": "string",
        "uri": "string",
        "task": {
            "task_id": "string",
            "run_id": "string",
            "project": "string",
            "caller": "string",
            "parent_id": "string",
            "thread_id": "string"
        }
    }
    

  • 404 Not Found – Not Found Error

  • 500 Internal Server Error – Internal Server Error