1. Introduction

This is the REST API documentation for Genie version 3.3.9. Here you will find specific details of how to invoke the Genie REST API and what you can expect as return values.

For more Genie information see the website.
For high level information and installation instructions please see the reference guide.
For a demo of this version of Genie please see demo guide.

2. Assumptions

This documentation assumes a basic knowledge of how REST APIs work. If you don’t know things like HTTP verbs see websites like this one.

3. HATEOAS

A lot of the API’s return application/hal+json as a content type. This is a superset of JSON built to support HATEOAS (Hypermedia as the Engine of Application State). Rather than re-writing what HATEOAS is see this great write up on the Spring Website about it.

HATEOAS has several ways to represent the state in return payloads. Genie uses HAL. You can find documentation about it here or here.

4. Security

All of this documentation assumes security is disabled for Genie. If your installation has security enabled the REST APIs will be secured via OAuth2 or x509 certs or both.

These are the currently supported API security mechanisms but others could be plugged in. We’ll only talk about OAuth2 here for now until another implementation is done.

4.1. OAuth2

If OAuth2 is enabled you’ll need to send your JWT you got back from your provider along with your API request. This is accomplished by setting your Authorization header to a value of Bearer {your token here}.

4.2. x509

If your admin has security Genie using client and server certificates mechanisms you’ll need to send your client certificate along with your request.

Something like curl --cert {your cert} {genie endpoint}

5. Resources

This section contains the documentation for various resources sent to and from the various Genie APIs. Note their structure and fields, particularly what is marked optional. Optional means when you submit one of these resources to Genie you don’t need to set that field. Genie either doesn’t require it or if it does, as is the case with ID’s, it will create one if you don’t provide it. When you get a resource all fields Genie has stored will be returned.

5.1. Application

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

type

String

The type of application this is (e.g. hadoop, presto, spark). Can be used to group.

true

status

String

The status of the application. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

dependencies

Array

The dependencies for the application

true

5.2. Cluster

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the cluster. Options: [UP, OUT_OF_SERVICE, TERMINATED]

Must not be null

false

dependencies

Array

The dependencies for the cluster

true

5.3. Command

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the command. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

executable

String

The executable to run on the Genie node when this command is used. e.g. /usr/bin/hadoop

Must not be empty. Size must be between 0 and 255 inclusive

false

checkDelay

Number

The amount of time (in milliseconds) to delay between checks of the jobs using this command

Must be at least 1

false

memory

Number

The default amount of memory (in MB) that should be allocated for instances of this command client

Must be at least 1

true

dependencies

Array

The dependencies for the command

true

5.4. Job Request

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

commandArgs

String

Any arguments to append to the command executable when the job is run

true

clusterCriterias

Array

List of cluster criteria’s for which a match will be attempted with register cluster tags. Each set of tags within a given cluster criteria must have at least one non-blank (e.g. ' ', ' ', null) tag.

Must not be empty

false

commandCriteria

Array

Set of tags which will attempt to match against the commands linked to selected cluster. There must be at least one non-blank (e.g. ' ', ' ', null) criteria within the set

Must not be empty

false

group

String

A group that the job should be run under on the linux system

Size must be between 0 and 255 inclusive

true

disableLogArchival

Boolean

If you want to disable backing up job output files set this to true. Default: false

true

email

String

If you want e-mail notification on job completion enter address here

Must be a well-formed email address. Size must be between 0 and 255 inclusive

true

cpu

Number

For future use. Currently has no impact.

Must be at least 1

true

memory

Number

The amount of memory (in MB) desired for job client. Cannot exceed configured max.

Must be at least 1

true

timeout

Number

The timeout (in seconds) after which job will be killed by system, system setting used if not set

Must be at least 1

true

configs

Array

URI’s of configuration files which will be downloaded into job working directory at runtime

true

dependencies

Array

URI’s of dependency files which will be downloaded into job working directory at runtime

true

applications

Array

Complete list of application ids if power user wishes to override selected command defaults

true

grouping

String

The grouping of the job relative to other jobs. e.g. scheduler job name

true

groupingInstance

String

The grouping instance of the job relative to other jobs. e.g. scheduler job run

true

5.5. Job

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

commandArgs

String

Any arguments to append to the command executable when the job is run

true

status

String

The status of the job. Options: [INIT, RUNNING, SUCCEEDED, KILLED, FAILED, INVALID]

Must not be null

false

statusMsg

String

The status message of the job

Size must be between 0 and 255 inclusive

true

started

String

The time (UTC ISO8601 with millis) the job was started

true

finished

String

The time (UTC ISO8601 with millis) the job finished

true

archiveLocation

String

The URI where the working directory zip was stored

Size must be between 0 and 1024 inclusive

true

clusterName

String

The name of the cluster the job was run on if it’s been determined

Size must be between 0 and 255 inclusive

true

commandName

String

The name of the command the job was run with if it’s been determined

Size must be between 0 and 255 inclusive

true

runtime

String

Runtime of the job in ISO8601 duration format

Must not be null

true

grouping

String

The grouping of the job relative to other jobs. e.g. scheduler job name

true

groupingInstance

String

The grouping instance of the job relative to other jobs. e.g. scheduler job run

true

5.6. Job Execution

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

hostName

String

The host name of the Genie node responsible for the job

Size must be between 1 and 1024 inclusive

false

processId

Number

The id of the job client process on the Genie node

true

checkDelay

Number

The amount of time in milliseconds between checks of the job status by Genie

Must be at least 1

true

timeout

String

The date (UTC ISO8601 with millis) when the job will be killed by Genie due to timeout

true

exitCode

Number

The job client process exit code after the job is done

true

memory

Number

The amount of memory (in MB) allocated to the job client

Must be at least 1

true

5.7. Job Metadata

Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

clientHost

String

The host name of the client that submitted the job to Genie

true

userAgent

String

The user agent string that was passed to Genie on job request

true

numAttachments

Number

The number of attachments sent to Genie with the job request

true

totalSizeOfAttachments

Number

The total size of all attachments sent to Genie with the job request. In bytes.

true

stdOutSize

Number

The final size of the stdout file after a job is completed. In bytes.

true

stdErrSize

Number

The final size of the stderr file after a job is completed. In bytes.

true

6. Jobs API

6.1. Submit a Job

6.1.1. Description

The main API in Genie. Submitting a job to be run.

There are two different ways to submit a job to Genie. Both go to the same endpoint but you can simply send a JSON payload if you have no attachments. This means setting your content type to application/json. If you do have attachments you want to send with your job request you need to set the content type to multipart/form-data and post the request that way. Examples are below.

6.1.2. Endpoint

POST /api/v3/jobs

The id in this example is optional. If you include one Genie will use it. If not it will provide one. If you provide one it must be unique.
This Example is without attachments

6.1.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters

None

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

commandArgs

String

Any arguments to append to the command executable when the job is run

true

clusterCriterias

Array

List of cluster criteria’s for which a match will be attempted with register cluster tags. Each set of tags within a given cluster criteria must have at least one non-blank (e.g. ' ', ' ', null) tag.

Must not be empty

false

commandCriteria

Array

Set of tags which will attempt to match against the commands linked to selected cluster. There must be at least one non-blank (e.g. ' ', ' ', null) criteria within the set

Must not be empty

false

group

String

A group that the job should be run under on the linux system

Size must be between 0 and 255 inclusive

true

disableLogArchival

Boolean

If you want to disable backing up job output files set this to true. Default: false

true

email

String

If you want e-mail notification on job completion enter address here

Must be a well-formed email address. Size must be between 0 and 255 inclusive

true

cpu

Number

For future use. Currently has no impact.

Must be at least 1

true

memory

Number

The amount of memory (in MB) desired for job client. Cannot exceed configured max.

Must be at least 1

true

timeout

Number

The timeout (in seconds) after which job will be killed by system, system setting used if not set

Must be at least 1

true

configs

Array

URI’s of configuration files which will be downloaded into job working directory at runtime

true

dependencies

Array

URI’s of dependency files which will be downloaded into job working directory at runtime

true

applications

Array

Complete list of application ids if power user wishes to override selected command defaults

true

grouping

String

The grouping of the job relative to other jobs. e.g. scheduler job name

true

groupingInstance

String

The grouping instance of the job relative to other jobs. e.g. scheduler job run

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0",
  "user" : "genie",
  "name" : "List * ... Directories bash job",
  "description" : "Genie 3 Test Job",
  "metadata" : {
    "schedulerJobName" : "fd06eba1-1d96-436a-a6d4-1c6dd564142c",
    "schedulerRunId" : "6ea0656b-8992-4cb4-87fe-2fd9aaa707fc"
  },
  "tags" : [ "cdf2e1a5-b73b-4043-a266-66a3a2929e14", "8b4d3dd4-8713-41d7-923e-ed54670c47d5" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/config1" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/dep1" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile",
  "commandArgs" : "-c 'echo hello world'",
  "clusterCriterias" : [ {
    "tags" : [ "localhost" ]
  } ],
  "commandCriteria" : [ "bash" ],
  "group" : null,
  "disableLogArchival" : true,
  "email" : null,
  "cpu" : null,
  "memory" : null,
  "timeout" : null,
  "applications" : [ ],
  "grouping" : null,
  "groupingInstance" : null
}'
HTTPie
$ echo '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0",
  "user" : "genie",
  "name" : "List * ... Directories bash job",
  "description" : "Genie 3 Test Job",
  "metadata" : {
    "schedulerJobName" : "fd06eba1-1d96-436a-a6d4-1c6dd564142c",
    "schedulerRunId" : "6ea0656b-8992-4cb4-87fe-2fd9aaa707fc"
  },
  "tags" : [ "cdf2e1a5-b73b-4043-a266-66a3a2929e14", "8b4d3dd4-8713-41d7-923e-ed54670c47d5" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/config1" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/dep1" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile",
  "commandArgs" : "-c 'echo hello world'",
  "clusterCriterias" : [ {
    "tags" : [ "localhost" ]
  } ],
  "commandCriteria" : [ "bash" ],
  "group" : null,
  "disableLogArchival" : true,
  "email" : null,
  "cpu" : null,
  "memory" : null,
  "timeout" : null,
  "applications" : [ ],
  "grouping" : null,
  "groupingInstance" : null
}' | http POST 'https://genie.example.com/api/v3/jobs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers
Name Description

Location

The URI

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/jobs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 1262

{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0",
  "user" : "genie",
  "name" : "List * ... Directories bash job",
  "description" : "Genie 3 Test Job",
  "metadata" : {
    "schedulerJobName" : "fd06eba1-1d96-436a-a6d4-1c6dd564142c",
    "schedulerRunId" : "6ea0656b-8992-4cb4-87fe-2fd9aaa707fc"
  },
  "tags" : [ "cdf2e1a5-b73b-4043-a266-66a3a2929e14", "8b4d3dd4-8713-41d7-923e-ed54670c47d5" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/config1" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/dep1" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile",
  "commandArgs" : "-c 'echo hello world'",
  "clusterCriterias" : [ {
    "tags" : [ "localhost" ]
  } ],
  "commandCriteria" : [ "bash" ],
  "group" : null,
  "disableLogArchival" : true,
  "email" : null,
  "cpu" : null,
  "memory" : null,
  "timeout" : null,
  "applications" : [ ],
  "grouping" : null,
  "groupingInstance" : null
}
Response
HTTP/1.1 202 Accepted
X-Application-Context: genie:integration,db,db-h2:0
Location: https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7
This example is with attachments

6.1.4. API Docs

Request Documentation
Headers
Name Description

Content-Type

multipart/form-data

Path Parameters

None

Query Parameters

None

Payload Fields
Part Description

request

The job request JSON. Content type must be application/json for part

attachment

An attachment file. There can be multiple. Type should be octet-stream

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs' -i -X POST -H 'Content-Type: multipart/form-data;charset=UTF-8' -F 'request={"id":null,"created":null,"updated":null,"version":"1.0","user":"genie","name":"List * ... Directories bash job","description":"Genie 3 Test Job","metadata":null,"tags":[],"configs":[],"dependencies":[],"setupFile":"/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile","commandArgs":"-c 'echo hello world'","clusterCriterias":[{"tags":["localhost"]}],"commandCriteria":["bash"],"group":null,"disableLogArchival":true,"email":null,"cpu":null,"memory":null,"timeout":null,"applications":[],"grouping":null,"groupingInstance":null};type=application/json' -F 'attachment=@query.sql;type=application/octet-stream' -F 'attachment=@query2.sql;type=application/octet-stream'
HTTPie
$ http --form POST 'https://genie.example.com/api/v3/jobs' \
  'request'@<(echo '{"id":null,"created":null,"updated":null,"version":"1.0","user":"genie","name":"List * ... Directories bash job","description":"Genie 3 Test Job","metadata":null,"tags":[],"configs":[],"dependencies":[],"setupFile":"/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile","commandArgs":"-c 'echo hello world'","clusterCriterias":[{"tags":["localhost"]}],"commandCriteria":["bash"],"group":null,"disableLogArchival":true,"email":null,"cpu":null,"memory":null,"timeout":null,"applications":[],"grouping":null,"groupingInstance":null}') \
  'attachment'@'query.sql' \
  'attachment'@'query2.sql'
Response Documentation
Headers
Name Description

Location

The URI

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/jobs HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: genie.example.com

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=request
Content-Type: application/json

{"id":null,"created":null,"updated":null,"version":"1.0","user":"genie","name":"List * ... Directories bash job","description":"Genie 3 Test Job","metadata":null,"tags":[],"configs":[],"dependencies":[],"setupFile":"/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile","commandArgs":"-c 'echo hello world'","clusterCriterias":[{"tags":["localhost"]}],"commandCriteria":["bash"],"group":null,"disableLogArchival":true,"email":null,"cpu":null,"memory":null,"timeout":null,"applications":[],"grouping":null,"groupingInstance":null}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=attachment
Content-Type: application/octet-stream

select * from myTable;

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=attachment
Content-Type: application/octet-stream

SELECT * FROM your_table JOIN my_table ON your_table.id = my_table.id WHERE x > 50;

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 202 Accepted
X-Application-Context: genie:integration,db,db-h2:0
Location: https://genie.example.com/api/v3/jobs/1247b3cc-8738-462c-b70c-a2875e02a401

6.2. Find Jobs

6.2.1. Description

Search for jobs using query parameters.

6.2.2. Endpoint

GET /api/v3/jobs

6.2.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters
Parameter Description

page

The page number to get. Default to 0.

size

The size of the page to get. Default to 64.

sort

The fields to sort the results by. Defaults to 'updated,desc'.

id

The id of the jobs to find. Use % symbol for regex like search.

name

The name of the jobs to find. Use % symbol for regex like search.

user

The user of the jobs to find. Use % symbol for regex like search.

status

The status(es) of the jobs to find. Can have multiple. Options: [INIT, RUNNING, SUCCEEDED, KILLED, FAILED, INVALID]

tag

The tag(s) of the jobs to find. Can have multiple.

clusterName

The name of the cluster on which the jobs ran. Use % symbol for regex like search.

clusterId

The id of the cluster on which the jobs ran.

commandName

The name of the command which was executed by the job. Use % symbol for regex like search.

commandId

The id of the command which was executed by the job.

minStarted

The minimum started time of the job in milliseconds since epoch. (inclusive)

maxStarted

The maximum started time of the job in milliseconds since epoch. (exclusive)

minFinished

The minimum finished time of the job in milliseconds since epoch. (inclusive)

maxFinished

The maximum finished time of the job in milliseconds since epoch. (exclusive)

grouping

The grouping the job should be a member of. Use % symbol for regex like search.

groupingInstance

The grouping instance the job should be a member of. Use % symbol for regex like search.

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs?user=genie' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs?user=genie'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

_links

Object

Links to other resources.

false

page

Object

The result page information.

false

page.size

Number

The number of elements in this page result.

false

page.totalElements

Number

The total number of elements this search result could return.

false

page.totalPages

Number

The total number of pages there could be at the current page size.

false

page.number

Number

The current page number.

false

_embedded.jobSearchResultList

Array

The found jobs.

false

Relation Description

self

The current search

first

The first page for this search

prev

The previous page for this search

next

The next page for this search

last

The last page for this search

HTTP Messages
Request
GET /api/v3/jobs?user=genie HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 947

{
  "_embedded" : {
    "jobSearchResultList" : [ {
      "id" : "b1d8591f-f603-4753-9603-bb00fc5187d7",
      "name" : "List * ... Directories bash job",
      "user" : "genie",
      "status" : "SUCCEEDED",
      "started" : "2018-05-15T00:10:45.815Z",
      "finished" : "2018-05-15T00:10:45.992Z",
      "clusterName" : "Local laptop",
      "commandName" : "Unix Bash command",
      "runtime" : "PT0.177S",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/jobs?user=genie{&id,name,status,tag,clusterName,clusterId,commandName,commandId,minStarted,maxStarted,minFinished,maxFinished,grouping,groupingInstance}",
      "templated" : true
    }
  },
  "page" : {
    "size" : 10,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

6.3. Get a Job

6.3.1. Description

Get metadata about a specific job.

6.3.2. Endpoint

GET /api/v3/jobs/{id}

6.3.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 1. /api/v3/jobs/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

commandArgs

String

Any arguments to append to the command executable when the job is run

true

status

String

The status of the job. Options: [INIT, RUNNING, SUCCEEDED, KILLED, FAILED, INVALID]

Must not be null

false

statusMsg

String

The status message of the job

Size must be between 0 and 255 inclusive

true

started

String

The time (UTC ISO8601 with millis) the job was started

true

finished

String

The time (UTC ISO8601 with millis) the job finished

true

archiveLocation

String

The URI where the working directory zip was stored

Size must be between 0 and 1024 inclusive

true

clusterName

String

The name of the cluster the job was run on if it’s been determined

Size must be between 0 and 255 inclusive

true

commandName

String

The name of the command the job was run with if it’s been determined

Size must be between 0 and 255 inclusive

true

runtime

String

Runtime of the job in ISO8601 duration format

Must not be null

true

grouping

String

The grouping of the job relative to other jobs. e.g. scheduler job name

true

groupingInstance

String

The grouping instance of the job relative to other jobs. e.g. scheduler job run

true

Relation Description

self

URI for this job

request

The request that kicked off this job

execution

The job execution information for this job

metadata

The job metadata information for this job

output

The output URI for the job

status

The current status of the job

cluster

The cluster this job ran on

command

The command this job executed

applications

The applications this job used

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 2026

{
  "id" : "b1d8591f-f603-4753-9603-bb00fc5187d7",
  "created" : "2018-05-15T00:10:45.572Z",
  "updated" : "2018-05-15T00:10:45.992Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "List * ... Directories bash job",
  "description" : "Genie 3 Test Job",
  "metadata" : {
    "schedulerJobName" : "fd06eba1-1d96-436a-a6d4-1c6dd564142c",
    "schedulerRunId" : "6ea0656b-8992-4cb4-87fe-2fd9aaa707fc"
  },
  "tags" : [ "cdf2e1a5-b73b-4043-a266-66a3a2929e14", "8b4d3dd4-8713-41d7-923e-ed54670c47d5" ],
  "status" : "SUCCEEDED",
  "statusMsg" : "Job finished successfully.",
  "started" : "2018-05-15T00:10:45.815Z",
  "finished" : "2018-05-15T00:10:45.992Z",
  "archiveLocation" : null,
  "clusterName" : "Local laptop",
  "commandName" : "Unix Bash command",
  "runtime" : "PT0.177S",
  "commandArgs" : "-c 'echo hello world'",
  "grouping" : null,
  "groupingInstance" : null,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7"
    },
    "output" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output"
    },
    "request" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request"
    },
    "execution" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution"
    },
    "metadata" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata"
    },
    "status" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status"
    },
    "cluster" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/cluster"
    },
    "command" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/command"
    },
    "applications" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/applications"
    }
  }
}

6.4. Kill a Job

6.4.1. Description

Request for a job to be killed.

6.4.2. Endpoint

DELETE /api/v3/jobs/{id}

6.4.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 2. /api/v3/jobs/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/7dfe46ba-ed4d-4a49-8c1b-90b2145c7d77' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/jobs/7dfe46ba-ed4d-4a49-8c1b-90b2145c7d77'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/jobs/7dfe46ba-ed4d-4a49-8c1b-90b2145c7d77 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 202 Accepted
X-Application-Context: genie:integration,db,db-h2:0

6.5. Get Job Status

6.5.1. Description

Get the current status of a job.

6.5.2. Endpoint

GET /api/v3/jobs/{id}/status

6.5.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 3. /api/v3/jobs/{id}/status
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

status

String

The job status. One of: [INIT, RUNNING, SUCCEEDED, KILLED, FAILED, INVALID]

false

None

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 28

{
  "status" : "SUCCEEDED"
}

6.6. Get Contents From the Job Working Directory

6.6.1. Description

This API acts as a file browser for the remote working directory of your job. You can request endpoints and if it is a directory you will be shown the contents of the directory and be able to navigate. If the endpoint points to a file it will return the file.

6.6.2. Endpoint

GET /api/v3/jobs/{id}/output/{path}**

6.6.3. Getting a directory as JSON

This is the default behavior for directories if no Accept header is present

6.6.4. API Docs

Request Documentation
Headers
Name Description

Accept

application/json

Path Parameters
Table 4. /api/v3/jobs/{id}/output/{filePath}
Parameter Description

id

The resource id

filePath

The path to the directory to get

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

parent

Object

Information about the parent of this directory

true

parent.name

String

The name of the parent directory

true

parent.url

String

The url to get the parent

true

parent.size

Number

The size of the parent in bytes

true

parent.lastModified

String

The last time the parent was modified in ISO8601 UTC with milliseconds included

true

directories

Array

All the subdirectories of this directory

false

directories[].name

String

The name of the directory

false

directories[].url

String

The url to get the directory

false

directories[].size

Number

The size of the directory in bytes

false

directories[].lastModified

String

The last time the directory was modified in ISO8601 UTC with milliseconds included

false

files

Array

All the files in this directory

false

files[].name

String

The name of the file

false

files[].url

String

The url to get the file

false

files[].size

Number

The size of the file in bytes

false

files[].lastModified

String

The last time the file was modified in ISO8601 UTC with milliseconds included

false

None

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/ HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 1453

{
  "parent" : null,
  "directories" : [ {
    "name" : "genie/",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/genie/",
    "size" : 0,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  } ],
  "files" : [ {
    "name" : "config1",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/config1",
    "size" : 0,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  }, {
    "name" : "dep1",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/dep1",
    "size" : 0,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  }, {
    "name" : "jobsetupfile",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/jobsetupfile",
    "size" : 0,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  }, {
    "name" : "run",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/run",
    "size" : 3850,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  }, {
    "name" : "stderr",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/stderr",
    "size" : 0,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  }, {
    "name" : "stdout",
    "url" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/stdout",
    "size" : 12,
    "lastModified" : "2018-05-15T00:10:45.000Z"
  } ]
}

6.6.5. Getting a directory as HTML

This would happen automatically if you called from browser due to browser default accept header

6.6.6. API Docs

Request Documentation
Headers
Name Description

Accept

text/html

Path Parameters
Table 5. /api/v3/jobs/{id}/output/{filePath}
Parameter Description

id

The resource id

filePath

The path to the directory to get

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/' -i -H 'Accept: text/html'
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/' 'Accept:text/html'
Response Documentation
Headers
Name Description

Content-Type

text/html

Payload Fields

None

None

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/ HTTP/1.1
Accept: text/html
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: text/html;charset=UTF-8
Content-Length: 3097

<!DOCTYPE html><html><head><title>b1d8591f-f603-4753-9603-bb00fc5187d7</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}--></style> </head><body><h1>b1d8591f-f603-4753-9603-bb00fc5187d7</h1><HR size="1" noshade="noshade"><table width="100%" cellspacing="0" cellpadding="5" align="center"><tr><td align="left"><font size="+1"><strong>Filename</strong></font></td><td align="right"><font size="+1"><strong>Size</strong></font></td><td align="right"><font size="+1"><strong>Last Modified</strong></font></td></tr><tr bgcolor="#eeeeee"><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/genie/"><tt>genie/</tt></a></td><td align="right"><tt>-</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/config1"><tt>config1</tt></a></td><td align="right"><tt>0 bytes</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr bgcolor="#eeeeee"><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/dep1"><tt>dep1</tt></a></td><td align="right"><tt>0 bytes</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/jobsetupfile"><tt>jobsetupfile</tt></a></td><td align="right"><tt>0 bytes</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr bgcolor="#eeeeee"><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/run"><tt>run</tt></a></td><td align="right"><tt>3 KB</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/stderr"><tt>stderr</tt></a></td><td align="right"><tt>0 bytes</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr><tr bgcolor="#eeeeee"><td align="left">&nbsp;&nbsp;<a href="https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/stdout"><tt>stdout</tt></a></td><td align="right"><tt>12 bytes</tt></td><td align="right"><tt>Tue, 15 May 2018 00:10:45 GMT</tt></td></tr></table><HR size="1" noshade="noshade"><h3>Apache Tomcat/8.5.27</h3></body></html>

6.6.7. Getting a file

6.6.8. API Docs

Request Documentation
Headers
Name Description

Accept

/

Path Parameters
Table 6. /api/v3/jobs/{id}/output/{filePath}
Parameter Description

id

The resource id

filePath

The path to the file to get

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/run' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/run'
Response Documentation
Headers
Name Description

Content-Type

The content type of the file being returned

Payload Fields

None

None

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output/run HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Last-Modified: Tue, 15 May 2018 00:10:45 GMT
Content-Length: 3850
Content-Type: text/plain;charset=UTF-8
Accept-Ranges: bytes

#!/usr/bin/env bash

set -o nounset -o pipefail

# Set function in case any of the exports or source commands cause an error
trap "handle_failure" ERR EXIT

function handle_failure {
    ERROR_CODE=$?
    echo "Handling exit signal (code: ${ERROR_CODE})"

    # Good exit
    if [[ ${ERROR_CODE} -eq 0 ]]; then
        exit 0
    fi
    # Bad exit
    printf '{"exitCode": "%s"}\n' "${ERROR_CODE}" > ${GENIE_JOB_DIR}/genie/genie.done
    exit "${ERROR_CODE}"
}

# Set function for handling kill signal from the job kill service
trap "handle_kill_request" SIGTERM

function handle_kill_request {

    # Disable traps
    trap "" SIGTERM ERR EXIT

    echo "Kill signal received"

    KILL_EXIT_CODE=999

    ### Write the kill exit code to genie.done file as exit code before doing anything else
    echo "Generate done file with exit code ${KILL_EXIT_CODE}"
    printf '{"exitCode": "%s"}\n' "${KILL_EXIT_CODE}" > ${GENIE_JOB_DIR}/genie/genie.done

    ### Send a kill signal the entire process group
    echo "Sending a kill signal to the process group"
    pkill -P $$

    for ((iteration=1; iteration < 30; iteration++))
    {
        if kill -0 ${CHILDREN_PID} &> /dev/null;
        then
            echo "Waiting for children of ${SELF_PID} to terminate"
            pgrep -P ${SELF_PID}
            sleep 1
        else
            echo "Children process no longer running, exiting"
            exit 0
        fi
    }

    ### Reaching at this point means the children did not die. If so send kill -9 to the entire process group
    # this is a hard kill and will this process itself as well
    echo "Sending a kill -9 to children"

    pkill -9 -P $$
    echo "Done"
}

SELF_PID=$$

echo Start: `date '+%Y-%m-%d %H:%M:%S'`

export GENIE_JOB_DIR="/tmp/1526343031365-0/b1d8591f-f603-4753-9603-bb00fc5187d7"

export GENIE_APPLICATION_DIR="${GENIE_JOB_DIR}/genie/applications"

export GENIE_COMMAND_DIR="${GENIE_JOB_DIR}/genie/command/cmd1"

export GENIE_COMMAND_ID="cmd1"

export GENIE_COMMAND_NAME="Unix Bash command"

export GENIE_COMMAND_TAGS="bash,genie.id:cmd1,genie.name:Unix Bash command"

export GENIE_CLUSTER_DIR="${GENIE_JOB_DIR}/genie/cluster/cluster1"

export GENIE_CLUSTER_ID="cluster1"

export GENIE_CLUSTER_NAME="Local laptop"

export GENIE_CLUSTER_TAGS="genie.id:cluster1,genie.name:Local laptop,localhost"

export GENIE_JOB_ID="b1d8591f-f603-4753-9603-bb00fc5187d7"

export GENIE_JOB_NAME="List * ... Directories bash job"

export GENIE_JOB_MEMORY=1024

export GENIE_JOB_TAGS="8b4d3dd4-8713-41d7-923e-ed54670c47d5,cdf2e1a5-b73b-4043-a266-66a3a2929e14"

export GENIE_REQUESTED_COMMAND_TAGS="bash"

export GENIE_REQUESTED_CLUSTER_TAGS="[[localhost]]"
export GENIE_REQUESTED_CLUSTER_TAGS_0="localhost"

export GENIE_VERSION=3

# Sourcing setup file from Cluster: cluster1
source ${GENIE_JOB_DIR}/genie/cluster/cluster1/setupfile

# Sourcing setup file from Application: app1
source ${GENIE_JOB_DIR}/genie/applications/app1/setupfile

# Sourcing setup file from Application: app2
source ${GENIE_JOB_DIR}/genie/applications/app2/setupfile

# Sourcing setup file from Command: cmd1
source ${GENIE_JOB_DIR}/genie/command/cmd1/setupfile

# Sourcing setup file specified in job request
source ${GENIE_JOB_DIR}/jobsetupfile

# Dump the environment to a env.log file
env | sort > ${GENIE_JOB_DIR}/genie/logs/env.log

# Kick off the command in background mode and wait for it using its pid
/bin/bash -c 'echo hello world' > ${GENIE_JOB_DIR}/stdout 2> ${GENIE_JOB_DIR}/stderr &
export CHILDREN_PID=$!
wait ${CHILDREN_PID}

# Write the return code from the command in the done file.
printf '{"exitCode": "%s"}\n' "$?" > ${GENIE_JOB_DIR}/genie/genie.done.temp
# Swapping done file, unless one exist created by trap handler.
mv -n ${GENIE_JOB_DIR}/genie/genie.done.temp ${GENIE_JOB_DIR}/genie/genie.done
echo End: `date '+%Y-%m-%d %H:%M:%S'`

6.7. Get a Job Request

6.7.1. Description

Get the original request which spawned the job.

6.7.2. Endpoint

GET /api/v3/jobs/{id}/request

6.7.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 7. /api/v3/jobs/{id}/request
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

commandArgs

String

Any arguments to append to the command executable when the job is run

true

clusterCriterias

Array

List of cluster criteria’s for which a match will be attempted with register cluster tags. Each set of tags within a given cluster criteria must have at least one non-blank (e.g. ' ', ' ', null) tag.

Must not be empty

false

commandCriteria

Array

Set of tags which will attempt to match against the commands linked to selected cluster. There must be at least one non-blank (e.g. ' ', ' ', null) criteria within the set

Must not be empty

false

group

String

A group that the job should be run under on the linux system

Size must be between 0 and 255 inclusive

true

disableLogArchival

Boolean

If you want to disable backing up job output files set this to true. Default: false

true

email

String

If you want e-mail notification on job completion enter address here

Must be a well-formed email address. Size must be between 0 and 255 inclusive

true

cpu

Number

For future use. Currently has no impact.

Must be at least 1

true

memory

Number

The amount of memory (in MB) desired for job client. Cannot exceed configured max.

Must be at least 1

true

timeout

Number

The timeout (in seconds) after which job will be killed by system, system setting used if not set

Must be at least 1

true

configs

Array

URI’s of configuration files which will be downloaded into job working directory at runtime

true

dependencies

Array

URI’s of dependency files which will be downloaded into job working directory at runtime

true

applications

Array

Complete list of application ids if power user wishes to override selected command defaults

true

grouping

String

The grouping of the job relative to other jobs. e.g. scheduler job name

true

groupingInstance

String

The grouping instance of the job relative to other jobs. e.g. scheduler job run

true

Relation Description

self

URI for this job request

job

The job that resulted from this request

execution

The job execution that resulted from this request

metadata

The job metadata information for this job

output

The output URI for the job

status

The current status of the job

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 2096

{
  "id" : "b1d8591f-f603-4753-9603-bb00fc5187d7",
  "created" : "2018-05-15T00:10:45.572Z",
  "updated" : "2018-05-15T00:10:45.992Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "List * ... Directories bash job",
  "description" : "Genie 3 Test Job",
  "metadata" : {
    "schedulerJobName" : "fd06eba1-1d96-436a-a6d4-1c6dd564142c",
    "schedulerRunId" : "6ea0656b-8992-4cb4-87fe-2fd9aaa707fc"
  },
  "tags" : [ "cdf2e1a5-b73b-4043-a266-66a3a2929e14", "8b4d3dd4-8713-41d7-923e-ed54670c47d5" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/config1" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/dep1" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/job/jobsetupfile",
  "commandArgs" : "-c 'echo hello world'",
  "clusterCriterias" : [ {
    "tags" : [ "localhost" ]
  } ],
  "commandCriteria" : [ "bash" ],
  "group" : null,
  "disableLogArchival" : true,
  "email" : null,
  "cpu" : null,
  "memory" : null,
  "timeout" : null,
  "applications" : [ ],
  "grouping" : null,
  "groupingInstance" : null,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request"
    },
    "job" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7"
    },
    "execution" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution"
    },
    "output" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output"
    },
    "status" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status"
    },
    "metadata" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata"
    }
  }
}

6.8. Get a Job Execution

6.8.1. Description

Get metadata about a job execution. Information like where a job was run, its process exit code, etc.

6.8.2. Endpoint

GET /api/v3/jobs/{id}/execution

6.8.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 8. /api/v3/jobs/{id}/execution
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

hostName

String

The host name of the Genie node responsible for the job

Size must be between 1 and 1024 inclusive

false

processId

Number

The id of the job client process on the Genie node

true

checkDelay

Number

The amount of time in milliseconds between checks of the job status by Genie

Must be at least 1

true

timeout

String

The date (UTC ISO8601 with millis) when the job will be killed by Genie due to timeout

true

exitCode

Number

The job client process exit code after the job is done

true

memory

Number

The amount of memory (in MB) allocated to the job client

Must be at least 1

true

Relation Description

self

URI for this job execution

job

The job associated with this execution

request

The job request that spawned this execution

metadata

The job metadata information for this job

output

The output URI for the job

status

The current status of the job

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1078

{
  "id" : "b1d8591f-f603-4753-9603-bb00fc5187d7",
  "created" : "2018-05-15T00:10:45.572Z",
  "updated" : "2018-05-15T00:10:45.992Z",
  "hostName" : "travis-job-115c5238-63ef-4704-b76b-077449f2e946",
  "processId" : 6242,
  "checkDelay" : 500,
  "timeout" : "2018-05-22T00:10:45.795Z",
  "exitCode" : 0,
  "memory" : 1024,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution"
    },
    "job" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7"
    },
    "request" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request"
    },
    "output" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output"
    },
    "status" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status"
    },
    "metadata" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata"
    }
  }
}

6.9. Get Job Metadata

6.9.1. Description

Get metadata about a job beyond core information. Information like where a job was submitted from, how large its output files were, etc.

6.9.2. Endpoint

GET /api/v3/jobs/{id}/metadata

6.9.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 9. /api/v3/jobs/{id}/metadata
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

clientHost

String

The host name of the client that submitted the job to Genie

true

userAgent

String

The user agent string that was passed to Genie on job request

true

numAttachments

Number

The number of attachments sent to Genie with the job request

true

totalSizeOfAttachments

Number

The total size of all attachments sent to Genie with the job request. In bytes.

true

stdOutSize

Number

The final size of the stdout file after a job is completed. In bytes.

true

stdErrSize

Number

The final size of the stderr file after a job is completed. In bytes.

true

Relation Description

self

URI for this job metadata

job

The job associated with this execution

request

The job request that spawned this execution

execution

The job execution information for this job

output

The output URI for the job

status

The current status of the job

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1039

{
  "id" : "b1d8591f-f603-4753-9603-bb00fc5187d7",
  "created" : "2018-05-15T00:10:45.572Z",
  "updated" : "2018-05-15T00:10:45.992Z",
  "clientHost" : "127.0.0.1",
  "userAgent" : null,
  "numAttachments" : 0,
  "totalSizeOfAttachments" : 0,
  "stdOutSize" : 12,
  "stdErrSize" : 0,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/metadata"
    },
    "job" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7"
    },
    "request" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/request"
    },
    "output" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/output"
    },
    "status" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/status"
    },
    "execution" : {
      "href" : "https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/execution"
    }
  }
}

6.10. Get the Cluster a Job Ran On

6.10.1. Description

Get the metadata about the cluster which was selected to run the job based on the cluster and command criteria in the job request.

6.10.2. Endpoint

GET /api/v3/jobs/{id}/cluster

6.10.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 10. /api/v3/jobs/{id}/cluster
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/cluster' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/cluster'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the cluster. Options: [UP, OUT_OF_SERVICE, TERMINATED]

Must not be null

false

dependencies

Array

The dependencies for the cluster

true

Relation Description

self

URI for this cluster

commands

Get all the commands this cluster can use

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/cluster HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1375

{
  "id" : "cluster1",
  "created" : "2018-05-15T00:10:45.365Z",
  "updated" : "2018-05-15T00:10:45.481Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "Local laptop",
  "description" : null,
  "metadata" : null,
  "tags" : [ "localhost", "genie.id:cluster1", "genie.name:Local laptop" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/config1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/config2" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/dep1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/dep2" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/setupfile",
  "status" : "UP",
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/clusters/cluster1"
    },
    "commands" : {
      "href" : "https://genie.example.com/api/v3/clusters/cluster1/commands{?status}",
      "templated" : true
    }
  }
}

6.11. Get the Command a Job Executed

6.11.1. Description

Get the metadata about the command which was selected to be executed by the job based on the cluster and command criteria in the job request.

6.11.2. Endpoint

GET /api/v3/jobs/{id}/command

6.11.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 11. /api/v3/jobs/{id}/command
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/command' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/command'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the command. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

executable

String

The executable to run on the Genie node when this command is used. e.g. /usr/bin/hadoop

Must not be empty. Size must be between 0 and 255 inclusive

false

checkDelay

Number

The amount of time (in milliseconds) to delay between checks of the jobs using this command

Must be at least 1

false

memory

Number

The default amount of memory (in MB) that should be allocated for instances of this command client

Must be at least 1

true

dependencies

Array

The dependencies for the command

true

Relation Description

self

URI for this command

applications

Get all the applications this command depends on

clusters

Get all clusters this command is available on

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/command HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1686

{
  "id" : "cmd1",
  "created" : "2018-05-15T00:10:45.438Z",
  "updated" : "2018-05-15T00:10:45.462Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "Unix Bash command",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:Unix Bash command", "bash", "genie.id:cmd1" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cmd1/config1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cmd1/config2", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cmd1/GB18030.txt" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/dep1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cluster1/dep2" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/cmd1/setupfile",
  "status" : "ACTIVE",
  "executable" : "/bin/bash",
  "checkDelay" : 500,
  "memory" : null,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/commands/cmd1"
    },
    "applications" : {
      "href" : "https://genie.example.com/api/v3/commands/cmd1/applications"
    },
    "clusters" : {
      "href" : "https://genie.example.com/api/v3/commands/cmd1/clusters{?status}",
      "templated" : true
    }
  }
}

6.12. Get the Applications a Job Command Used

6.12.1. Description

Get the list of applications that were used by the command selected by job to execute.

6.12.2. Endpoint

GET /api/v3/jobs/{id}/applications

6.12.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 12. /api/v3/jobs/{id}/applications
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/applications' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/applications'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

[]

Array

The applications for the job

false

None

HTTP Messages
Request
GET /api/v3/jobs/b1d8591f-f603-4753-9603-bb00fc5187d7/applications HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 2674

[ {
  "id" : "app1",
  "created" : "2018-05-15T00:10:45.179Z",
  "updated" : "2018-05-15T00:10:45.179Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "Application 1",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:app1", "genie.name:Application 1" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app1/config1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app1/config2" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app1/dep1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app1/dep2" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app1/setupfile",
  "status" : "ACTIVE",
  "type" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/applications/app1"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/applications/app1/commands{?status}"
  } ]
}, {
  "id" : "app2",
  "created" : "2018-05-15T00:10:45.249Z",
  "updated" : "2018-05-15T00:10:45.249Z",
  "version" : "1.0",
  "user" : "genie",
  "name" : "Application 2",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:app2", "genie.name:Application 2" ],
  "configs" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app2/config1", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app2/config2" ],
  "dependencies" : [ "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app2/dep2", "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app2/dep1" ],
  "setupFile" : "/home/travis/build/Netflix/genie/genie-web/build/resources/test/com/netflix/genie/web/controllers/JobRestControllerIntegrationTests/app2/setupfile",
  "status" : "ACTIVE",
  "type" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/applications/app2"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/applications/app2/commands{?status}"
  } ]
} ]

7. Applications API

7.1. Create an Application

7.1.1. Description

Create a new application in the system.

7.1.2. Endpoint

POST /api/v3/applications

The id in this example is optional. If you include one Genie will use it. If not it will provide one. If you provide one it must be unique.

7.1.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters

None

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

type

String

The type of application this is (e.g. hadoop, presto, spark). Can be used to group.

true

status

String

The status of the application. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

dependencies

Array

The dependencies for the application

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : "Spark for Genie",
  "metadata" : null,
  "tags" : [ "type:spark", "ver:1.5.1" ],
  "configs" : [ "s3://mybucket/spark/1.5.1/spark-env.sh" ],
  "dependencies" : [ "s3://mybucket/spark/1.5.1/spark.tar.gz" ],
  "setupFile" : "s3://mybucket/spark/1.5.1/setup-spark.sh",
  "status" : "ACTIVE",
  "type" : "spark"
}'
HTTPie
$ echo '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : "Spark for Genie",
  "metadata" : null,
  "tags" : [ "type:spark", "ver:1.5.1" ],
  "configs" : [ "s3://mybucket/spark/1.5.1/spark-env.sh" ],
  "dependencies" : [ "s3://mybucket/spark/1.5.1/spark.tar.gz" ],
  "setupFile" : "s3://mybucket/spark/1.5.1/setup-spark.sh",
  "status" : "ACTIVE",
  "type" : "spark"
}' | http POST 'https://genie.example.com/api/v3/applications' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers
Name Description

Location

The URI

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/applications HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 448

{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : "Spark for Genie",
  "metadata" : null,
  "tags" : [ "type:spark", "ver:1.5.1" ],
  "configs" : [ "s3://mybucket/spark/1.5.1/spark-env.sh" ],
  "dependencies" : [ "s3://mybucket/spark/1.5.1/spark.tar.gz" ],
  "setupFile" : "s3://mybucket/spark/1.5.1/setup-spark.sh",
  "status" : "ACTIVE",
  "type" : "spark"
}
Response
HTTP/1.1 201 Created
X-Application-Context: genie:integration,db,db-h2:0
Location: https://genie.example.com/api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922

7.2. Get an Application

7.2.1. Description

Get the metadata about an application in the system.

7.2.2. Endpoint

GET /api/v3/applications/{id}

7.2.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 13. /api/v3/applications/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

type

String

The type of application this is (e.g. hadoop, presto, spark). Can be used to group.

true

status

String

The status of the application. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

dependencies

Array

The dependencies for the application

true

Relation Description

self

URI for this application

commands

Get all the commands using this application

HTTP Messages
Request
GET /api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 906

{
  "id" : "627f1c00-d5fb-47fb-8487-6a1bca241922",
  "created" : "2018-05-15T00:11:07.977Z",
  "updated" : "2018-05-15T00:11:07.977Z",
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : "Spark for Genie",
  "metadata" : null,
  "tags" : [ "type:spark", "genie.id:627f1c00-d5fb-47fb-8487-6a1bca241922", "ver:1.5.1", "genie.name:spark" ],
  "configs" : [ "s3://mybucket/spark/1.5.1/spark-env.sh" ],
  "dependencies" : [ "s3://mybucket/spark/1.5.1/spark.tar.gz" ],
  "setupFile" : "s3://mybucket/spark/1.5.1/setup-spark.sh",
  "status" : "ACTIVE",
  "type" : "spark",
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922"
    },
    "commands" : {
      "href" : "https://genie.example.com/api/v3/applications/627f1c00-d5fb-47fb-8487-6a1bca241922/commands{?status}",
      "templated" : true
    }
  }
}

7.3. Find Applications

7.3.1. Description

Find applications using various query parameters.

7.3.2. Endpoint

GET /api/v3/applications

7.3.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters
Parameter Description

page

The page number to get. Default to 0.

size

The size of the page to get. Default to 64.

sort

The fields to sort the results by. Defaults to 'updated,desc'.

name

The name of the applications to find. Use % to perform a regex like query

user

The user of the applications to find. Use % to perform a regex like query

status

The status(es) of the applications to find. Can have multiple. Options: [ACTIVE, DEPRECATED, INACTIVE]

tag

The tag(s) of the applications to find. Can have multiple.

type

The type of the applications to find. Use % to perform a regex like query

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications?status=ACTIVE&status=DEPRECATED' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications?status=ACTIVE&status=DEPRECATED'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

_links

Object

Links to other resources.

false

page

Object

The result page information.

false

page.size

Number

The number of elements in this page result.

false

page.totalElements

Number

The total number of elements this search result could return.

false

page.totalPages

Number

The total number of pages there could be at the current page size.

false

page.number

Number

The current page number.

false

_embedded.applicationList

Array

The found applications.

false

Relation Description

self

The current search

first

The first page for this search

prev

The previous page for this search

next

The next page for this search

last

The last page for this search

HTTP Messages
Request
GET /api/v3/applications?status=ACTIVE&status=DEPRECATED HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 6382

{
  "_embedded" : {
    "applicationList" : [ {
      "id" : "7cda2cf1-4886-475f-b026-e96d95b1a841",
      "created" : "2018-05-15T00:11:07.004Z",
      "updated" : "2018-05-15T00:11:07.004Z",
      "version" : "1.0.0",
      "user" : "genieUser7",
      "name" : "hive",
      "description" : "Hive 1.0.0 for Genie",
      "metadata" : null,
      "tags" : [ "genie.name:hive", "type:hive", "ver:1.0.0", "genie.id:7cda2cf1-4886-475f-b026-e96d95b1a841" ],
      "configs" : [ "s3://mybucket/hive/hive-env.sh", "s3://mybucket/hive/hive-log4j.properties" ],
      "dependencies" : [ "s3://mybucket/hive/hive-1.0.0.tar.gz" ],
      "setupFile" : "s3://mybucket/hive/setup-hive.sh",
      "status" : "ACTIVE",
      "type" : "hive",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/7cda2cf1-4886-475f-b026-e96d95b1a841"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/7cda2cf1-4886-475f-b026-e96d95b1a841/commands{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "50a9071a-fbd8-43b8-8597-106c4e725e6b",
      "created" : "2018-05-15T00:11:06.975Z",
      "updated" : "2018-05-15T00:11:06.975Z",
      "version" : "0.4.0",
      "user" : "genieUser6",
      "name" : "spark",
      "description" : "Pig 0.15.0 for Genie",
      "metadata" : null,
      "tags" : [ "genie.id:50a9071a-fbd8-43b8-8597-106c4e725e6b", "ver:0.15.0", "type:pig", "genie.name:spark" ],
      "configs" : [ "s3://mybucket/pig/pig.properties" ],
      "dependencies" : [ "s3://mybucket/pig/pig-0.15.0.tar.gz" ],
      "setupFile" : "s3://mybucket/pig/setup-pig.sh",
      "status" : "ACTIVE",
      "type" : "pig",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/50a9071a-fbd8-43b8-8597-106c4e725e6b"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/50a9071a-fbd8-43b8-8597-106c4e725e6b/commands{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "4e64f329-5cab-439e-ae0f-abf9f5d56f1d",
      "created" : "2018-05-15T00:11:06.944Z",
      "updated" : "2018-05-15T00:11:06.944Z",
      "version" : "1.3.1",
      "user" : "genieUser5",
      "name" : "spark",
      "description" : "Spark 1.3.1 for Genie",
      "metadata" : null,
      "tags" : [ "genie.id:4e64f329-5cab-439e-ae0f-abf9f5d56f1d", "type:spark", "ver:1.3.1", "genie.name:spark" ],
      "configs" : [ "s3://mybucket/spark/spark-env.sh" ],
      "dependencies" : [ "s3://mybucket/spark/spark-1.3.1.tar.gz" ],
      "setupFile" : "s3://mybucket/spark/setup-spark.sh",
      "status" : "DEPRECATED",
      "type" : "spark",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/4e64f329-5cab-439e-ae0f-abf9f5d56f1d"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/4e64f329-5cab-439e-ae0f-abf9f5d56f1d/commands{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "0e0a87c1-015d-45a4-852b-e9616732d3c5",
      "created" : "2018-05-15T00:11:06.920Z",
      "updated" : "2018-05-15T00:11:06.920Z",
      "version" : "1.4.0",
      "user" : "genieUser4",
      "name" : "spark",
      "description" : "Spark 1.4.0 for Genie",
      "metadata" : null,
      "tags" : [ "type:spark", "ver:1.4.0", "genie.id:0e0a87c1-015d-45a4-852b-e9616732d3c5", "genie.name:spark" ],
      "configs" : [ "s3://mybucket/spark/spark-env.sh" ],
      "dependencies" : [ "s3://mybucket/spark/spark-1.4.0.tar.gz" ],
      "setupFile" : "s3://mybucket/spark/setup-spark.sh",
      "status" : "DEPRECATED",
      "type" : "spark",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/0e0a87c1-015d-45a4-852b-e9616732d3c5"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/0e0a87c1-015d-45a4-852b-e9616732d3c5/commands{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "4e01fd46-5a02-4d5f-b21b-78cdcb752a66",
      "created" : "2018-05-15T00:11:06.868Z",
      "updated" : "2018-05-15T00:11:06.868Z",
      "version" : "1.5.0",
      "user" : "genieUser2",
      "name" : "spark",
      "description" : "Spark 1.5.0 for Genie",
      "metadata" : null,
      "tags" : [ "type:spark", "genie.id:4e01fd46-5a02-4d5f-b21b-78cdcb752a66", "ver:1.5.0", "genie.name:spark" ],
      "configs" : [ "s3://mybucket/spark/spark-env.sh" ],
      "dependencies" : [ "s3://mybucket/spark/spark-1.5.0.tar.gz" ],
      "setupFile" : "s3://mybucket/spark/setup-spark.sh",
      "status" : "ACTIVE",
      "type" : "spark",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/4e01fd46-5a02-4d5f-b21b-78cdcb752a66"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/4e01fd46-5a02-4d5f-b21b-78cdcb752a66/commands{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "bc1ab988-8dc7-454b-b45a-c1a922f89178",
      "created" : "2018-05-15T00:11:06.841Z",
      "updated" : "2018-05-15T00:11:06.841Z",
      "version" : "1.5.1",
      "user" : "genieUser1",
      "name" : "spark",
      "description" : "Spark 1.5.1 for Genie",
      "metadata" : null,
      "tags" : [ "type:spark", "ver:1.5.1", "genie.name:spark", "genie.id:bc1ab988-8dc7-454b-b45a-c1a922f89178" ],
      "configs" : [ "s3://mybucket/spark/spark-env.sh" ],
      "dependencies" : [ "s3://mybucket/spark/spark-1.5.1.tar.gz" ],
      "setupFile" : "s3://mybucket/spark/setup-spark.sh",
      "status" : "ACTIVE",
      "type" : "spark",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/applications/bc1ab988-8dc7-454b-b45a-c1a922f89178"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/applications/bc1ab988-8dc7-454b-b45a-c1a922f89178/commands{?status}",
          "templated" : true
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/applications?status=ACTIVE&status=DEPRECATED{&name,user,tag,type}",
      "templated" : true
    }
  },
  "page" : {
    "size" : 10,
    "totalElements" : 6,
    "totalPages" : 1,
    "number" : 0
  }
}

7.4. Update an Entire Application

7.4.1. Description

Update the metadata about an application. This method does a complete replace of the resource. Usual flow is to call to get the most recent state then update what you want and call this API with the result.

For more fine grained control call the PATCH API.

7.4.2. Endpoint

PUT /api/v3/applications/{id}

7.4.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 14. /api/v3/applications/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

type

String

The type of application this is (e.g. hadoop, presto, spark). Can be used to group.

true

status

String

The status of the application. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

dependencies

Array

The dependencies for the application

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : "0b6e9cad-e7a6-4982-bb38-1103a22ecae9",
  "created" : "2018-05-15T00:11:08.725Z",
  "updated" : "2018-05-15T00:11:08.725Z",
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:spark", "genie.id:0b6e9cad-e7a6-4982-bb38-1103a22ecae9" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "type" : null
}'
HTTPie
$ echo '{
  "id" : "0b6e9cad-e7a6-4982-bb38-1103a22ecae9",
  "created" : "2018-05-15T00:11:08.725Z",
  "updated" : "2018-05-15T00:11:08.725Z",
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:spark", "genie.id:0b6e9cad-e7a6-4982-bb38-1103a22ecae9" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "type" : null
}' | http PUT 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 434

{
  "id" : "0b6e9cad-e7a6-4982-bb38-1103a22ecae9",
  "created" : "2018-05-15T00:11:08.725Z",
  "updated" : "2018-05-15T00:11:08.725Z",
  "version" : "1.5.1",
  "user" : "genie",
  "name" : "spark",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:spark", "genie.id:0b6e9cad-e7a6-4982-bb38-1103a22ecae9" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "type" : null
}
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.5. Update Parts of an Application

7.5.1. Description

Update the metadata about an application using JSON Patch. This will ONLY update the fields you request be changed.

For more information about JSON Patch RFC see the website.

7.5.2. Endpoint

PATCH /api/v3/applications/{id}

7.5.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 15. /api/v3/applications/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of patches to apply

false

[].op

String

Patch operation to perform.

add, remove, replace, copy, move, test

false

[].path

String

The json path to operate on. e.g. /user

false

[].from

String

The json path to move or copy from. e.g. /user

true

[].value

String

The json value to put at the path for an add, replace or test

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9' -i -X PATCH -H 'Content-Type: application/json;charset=UTF-8' -d '[ {
  "op" : "replace",
  "path" : "/user",
  "value" : "655bf5b9-884a-4d1b-92c2-d54041cb0738"
} ]'
HTTPie
$ echo '[ {
  "op" : "replace",
  "path" : "/user",
  "value" : "655bf5b9-884a-4d1b-92c2-d54041cb0738"
} ]' | http PATCH 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PATCH /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 98

[ {
  "op" : "replace",
  "path" : "/user",
  "value" : "655bf5b9-884a-4d1b-92c2-d54041cb0738"
} ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.6. Delete All Applications

7.6.1. Description

Delete all the applications currently stored in the system.

7.6.2. Endpoint

DELETE /api/v3/applications

7.6.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.7. Delete an Application

7.7.1. Description

Delete an application currently configured in the system.

7.7.2. Endpoint

DELETE /api/v3/applications/{id}

7.7.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 16. /api/v3/applications/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/6a382e26-940b-45fd-9d1a-6a741409961f' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications/6a382e26-940b-45fd-9d1a-6a741409961f'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications/6a382e26-940b-45fd-9d1a-6a741409961f HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.8. Get Configs for Application

7.8.1. Description

Get the configuration file locations for an application.

7.8.2. Endpoint

GET /api/v3/applications/{id}/configs

7.8.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 17. /api/v3/applications/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

None

HTTP Messages
Request
GET /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "e2915fdf-11aa-437f-a302-a2722d6ee427", "a8d41c62-567f-410c-b402-a6b798ddbcf9" ]

7.9. Add Configs to Application

7.9.1. Description

Add configuration file locations to an existing application. Configurations are stored as a set so any duplicates will be ignored.

7.9.2. Endpoint

POST /api/v3/applications/{id}/configs

7.9.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 18. /api/v3/applications/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "e2915fdf-11aa-437f-a302-a2722d6ee427", "a8d41c62-567f-410c-b402-a6b798ddbcf9" ]'
HTTPie
$ echo '[ "e2915fdf-11aa-437f-a302-a2722d6ee427", "a8d41c62-567f-410c-b402-a6b798ddbcf9" ]' | http POST 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "e2915fdf-11aa-437f-a302-a2722d6ee427", "a8d41c62-567f-410c-b402-a6b798ddbcf9" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.10. Update Configs for an Application

7.10.1. Description

Update the configuration file locations for an existing application. Stored as a set so duplicates are ignored.

7.10.2. Endpoint

PUT /api/v3/applications/{id}/configs

7.10.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 19. /api/v3/applications/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "64fa498f-a899-4a4e-be7e-121a395b65b1" ]'
HTTPie
$ echo '[ "64fa498f-a899-4a4e-be7e-121a395b65b1" ]' | http PUT 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "64fa498f-a899-4a4e-be7e-121a395b65b1" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.11. Remove All Configs From an Application

7.11.1. Description

Remove all the configuration file locations for an existing application.

7.11.2. Endpoint

DELETE /api/v3/applications/{id}/configs

7.11.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 20. /api/v3/applications/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.12. Get Dependencies For an Application

7.12.1. Description

Get the dependency file locations for an application.

7.12.2. Endpoint

GET /api/v3/applications/{id}/dependencies

7.12.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 21. /api/v3/applications/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

None

HTTP Messages
Request
GET /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "bdbe67bd-9017-4ce4-aa03-6d2d907d572c", "2f817dc4-18ef-4662-81d9-23754bcbb703" ]

7.13. Add Dependencies to Application

7.13.1. Description

Add dependency file locations to an existing application. Stored as a set so all duplicates are ignored.

7.13.2. Endpoint

POST /api/v3/applications/{id}/dependencies

7.13.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 22. /api/v3/applications/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "bdbe67bd-9017-4ce4-aa03-6d2d907d572c", "2f817dc4-18ef-4662-81d9-23754bcbb703" ]'
HTTPie
$ echo '[ "bdbe67bd-9017-4ce4-aa03-6d2d907d572c", "2f817dc4-18ef-4662-81d9-23754bcbb703" ]' | http POST 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "bdbe67bd-9017-4ce4-aa03-6d2d907d572c", "2f817dc4-18ef-4662-81d9-23754bcbb703" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.14. Update Dependencies for an Application

7.14.1. Description

Update the dependency file locations for an existing application

7.14.2. Endpoint

PUT /api/v3/applications/{id}/dependencies

7.14.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 23. /api/v3/applications/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "27b97370-f38b-4fc4-a735-f964dabcc7d2" ]'
HTTPie
$ echo '[ "27b97370-f38b-4fc4-a735-f964dabcc7d2" ]' | http PUT 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "27b97370-f38b-4fc4-a735-f964dabcc7d2" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.15. Remove All Dependencies From an Application

7.15.1. Description

Remove all the dependency file locations for an existing application.

7.15.2. Endpoint

DELETE /api/v3/applications/{id}/dependencies

7.15.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 24. /api/v3/applications/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.16. Get Tags For an Application

7.16.1. Description

Get the tags for an application.

7.16.2. Endpoint

GET /api/v3/applications/{id}/tags

7.16.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 25. /api/v3/applications/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

None

HTTP Messages
Request
GET /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 151

[ "ea748e6d-3872-40da-af33-19e15708d79f", "e2452dab-247c-476d-93d8-5ba4e7e5586d", "genie.name:spark", "genie.id:0b6e9cad-e7a6-4982-bb38-1103a22ecae9" ]

7.17. Add Tags to Application

7.17.1. Description

Add tags to an existing application. Stored as a set so all duplicates are ignored.

genie.id:{id} and genie.name:{name} tags are automatically added by the service.

7.17.2. Endpoint

POST /api/v3/applications/{id}/tags

7.17.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 26. /api/v3/applications/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "e2452dab-247c-476d-93d8-5ba4e7e5586d", "ea748e6d-3872-40da-af33-19e15708d79f" ]'
HTTPie
$ echo '[ "e2452dab-247c-476d-93d8-5ba4e7e5586d", "ea748e6d-3872-40da-af33-19e15708d79f" ]' | http POST 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "e2452dab-247c-476d-93d8-5ba4e7e5586d", "ea748e6d-3872-40da-af33-19e15708d79f" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.18. Update Tags for an Application

7.18.1. Description

Update the tags for an existing application.

The genie.id:{id} and genie.name:{name} tags can’t be removed. They will automatically be added back by the system.

7.18.2. Endpoint

PUT /api/v3/applications/{id}/tags

7.18.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 27. /api/v3/applications/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "d02ce119-8fe2-4f8d-bda0-ac3a503c6cb6" ]'
HTTPie
$ echo '[ "d02ce119-8fe2-4f8d-bda0-ac3a503c6cb6" ]' | http PUT 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "d02ce119-8fe2-4f8d-bda0-ac3a503c6cb6" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.19. Remove All Tags From Application

7.19.1. Description

Remove all the tags for an existing application

The genie.id:{id} and genie.name:{name} tags will NOT be removed by this operation

7.19.2. Endpoint

DELETE /api/v3/applications/{id}/tags

7.19.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 28. /api/v3/applications/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.20. Remove Tag From Application

7.20.1. Description

Remove a tag from an existing application.

You can’t remove the genie.id:{id} and genie.name:{name} tags. They will just be added back by the system

7.20.2. Endpoint

DELETE /api/v3/applications/{id}/tags/{tag}

7.20.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 29. /api/v3/applications/{id}/tags/{tag}
Parameter Description

id

The resource id

tag

The tag to remove

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags/678d28ad-491e-4c08-81eb-62df82b1fe2a' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags/678d28ad-491e-4c08-81eb-62df82b1fe2a'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/tags/678d28ad-491e-4c08-81eb-62df82b1fe2a HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

7.21. Get the Commands that Use an Application

7.21.1. Description

Search the commands that use the given application.

7.21.2. Endpoint

GET /api/v3/applications/{id}/commands

7.21.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 30. /api/v3/applications/{id}/commands
Parameter Description

id

The resource id

Query Parameters
Parameter Description

status

The status of commands to search for

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/commands?status=ACTIVE&status=INACTIVE' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/commands?status=ACTIVE&status=INACTIVE'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

[]

Array

The list of commands found

false

None

HTTP Messages
Request
GET /api/v3/applications/0b6e9cad-e7a6-4982-bb38-1103a22ecae9/commands?status=ACTIVE&status=INACTIVE HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1064

[ {
  "id" : "01f6091b-4d95-412e-a27d-ded84a08f67e",
  "created" : "2018-05-15T00:11:09.029Z",
  "updated" : "2018-05-15T00:11:09.075Z",
  "version" : "153f9597-7aa5-4da9-86fd-2e603706e19b",
  "user" : "153f9597-7aa5-4da9-86fd-2e603706e19b",
  "name" : "153f9597-7aa5-4da9-86fd-2e603706e19b",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:01f6091b-4d95-412e-a27d-ded84a08f67e", "genie.name:153f9597-7aa5-4da9-86fd-2e603706e19b" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "executable" : "153f9597-7aa5-4da9-86fd-2e603706e19b",
  "checkDelay" : 1000,
  "memory" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/commands/01f6091b-4d95-412e-a27d-ded84a08f67e"
  }, {
    "rel" : "applications",
    "href" : "https://genie.example.com/api/v3/commands/01f6091b-4d95-412e-a27d-ded84a08f67e/applications"
  }, {
    "rel" : "clusters",
    "href" : "https://genie.example.com/api/v3/commands/01f6091b-4d95-412e-a27d-ded84a08f67e/clusters{?status}"
  } ]
} ]

8. Clusters API

8.1. Create a Cluster

8.1.1. Description

Create a new cluster in the system.

8.1.2. Endpoint

POST /api/v3/clusters

The id in this example is optional. If you include one Genie will use it. If not it will provide one. If you provide one it must be unique.

8.1.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters

None

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the cluster. Options: [UP, OUT_OF_SERVICE, TERMINATED]

Must not be null

false

dependencies

Array

The dependencies for the cluster

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "UP"
}'
HTTPie
$ echo '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "UP"
}' | http POST 'https://genie.example.com/api/v3/clusters' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers
Name Description

Location

The URI

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/clusters HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 266

{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "UP"
}
Response
HTTP/1.1 201 Created
X-Application-Context: genie:integration,db,db-h2:0
Location: https://genie.example.com/api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e

8.2. Get a Cluster

8.2.1. Description

Get the metadata about a cluster in the system.

8.2.2. Endpoint

GET /api/v3/clusters/{id}

8.2.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 31. /api/v3/clusters/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the cluster. Options: [UP, OUT_OF_SERVICE, TERMINATED]

Must not be null

false

dependencies

Array

The dependencies for the cluster

true

Relation Description

self

URI for this cluster

commands

Get all the commands this cluster can use

HTTP Messages
Request
GET /api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 716

{
  "id" : "3511c444-2e47-458e-86ce-4bd61acd9e2e",
  "created" : "2018-05-15T00:11:10.237Z",
  "updated" : "2018-05-15T00:11:10.237Z",
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:3511c444-2e47-458e-86ce-4bd61acd9e2e", "genie.name:h2prod" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "UP",
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e"
    },
    "commands" : {
      "href" : "https://genie.example.com/api/v3/clusters/3511c444-2e47-458e-86ce-4bd61acd9e2e/commands{?status}",
      "templated" : true
    }
  }
}

8.3. Find Clusters

8.3.1. Description

Find clusters using various query parameters.

8.3.2. Endpoint

GET /api/v3/clusters

8.3.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters
Parameter Description

page

The page number to get. Default to 0.

size

The size of the page to get. Default to 64.

sort

The fields to sort the results by. Defaults to 'updated,desc'.

name

The name of the clusters to find. Use % to perform a regex like query

status

The status(es) of the clusters to find. Can have multiple. Options: [UP, OUT_OF_SERVICE, TERMINATED]

tag

The tag(s) of the clusters to find. Can have multiple.

minUpdateTime

The minimum time (in milliseconds from epoch UTC) that the cluster(s) were updated at.

maxUpdateTime

The maximum time (in milliseconds from epoch UTC) that the cluster(s) were updated at.

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters?tag=genie.id%3A040aa306-853c-404a-9bce-340ecbbf2cd5' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters?tag=genie.id%3A040aa306-853c-404a-9bce-340ecbbf2cd5'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

_links

Object

Links to other resources.

false

page

Object

The result page information.

false

page.size

Number

The number of elements in this page result.

false

page.totalElements

Number

The total number of elements this search result could return.

false

page.totalPages

Number

The total number of pages there could be at the current page size.

false

page.number

Number

The current page number.

false

_embedded.clusterList

Array

The found clusters.

false

Relation Description

self

The current search

first

The first page for this search

prev

The previous page for this search

next

The next page for this search

last

The last page for this search

HTTP Messages
Request
GET /api/v3/clusters?tag=genie.id%3A040aa306-853c-404a-9bce-340ecbbf2cd5 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1297

{
  "_embedded" : {
    "clusterList" : [ {
      "id" : "040aa306-853c-404a-9bce-340ecbbf2cd5",
      "created" : "2018-05-15T00:11:14.011Z",
      "updated" : "2018-05-15T00:11:14.011Z",
      "version" : "42418ef4-3e2b-4780-9596-cb152eac9163",
      "user" : "3f3d665f-632f-4e7d-9d7e-089a5792d697",
      "name" : "ec84d972-fd54-4992-84cb-47025b8e01db",
      "description" : null,
      "metadata" : null,
      "tags" : [ "genie.id:040aa306-853c-404a-9bce-340ecbbf2cd5", "genie.name:ec84d972-fd54-4992-84cb-47025b8e01db" ],
      "configs" : [ ],
      "dependencies" : [ ],
      "setupFile" : null,
      "status" : "UP",
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/clusters/040aa306-853c-404a-9bce-340ecbbf2cd5"
        },
        "commands" : {
          "href" : "https://genie.example.com/api/v3/clusters/040aa306-853c-404a-9bce-340ecbbf2cd5/commands{?status}",
          "templated" : true
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/clusters?tag=genie.id:040aa306-853c-404a-9bce-340ecbbf2cd5{&name,status,minUpdateTime,maxUpdateTime}",
      "templated" : true
    }
  },
  "page" : {
    "size" : 64,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

8.4. Update an Entire Cluster

8.4.1. Description

Update the metadata about a cluster. This method does a complete replace of the resource. Usual flow is to call to get the most recent state then update what you want and call this API with the result.

For more fine grained control call the PATCH API.

8.4.2. Endpoint

PUT /api/v3/clusters/{id}

8.4.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 32. /api/v3/clusters/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the cluster. Options: [UP, OUT_OF_SERVICE, TERMINATED]

Must not be null

false

dependencies

Array

The dependencies for the cluster

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : "431c9d16-a0b9-4b96-ad26-d3af271d02ad",
  "created" : "2018-05-15T00:11:16.530Z",
  "updated" : "2018-05-15T00:11:16.530Z",
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:h2prod", "genie.id:431c9d16-a0b9-4b96-ad26-d3af271d02ad" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "OUT_OF_SERVICE"
}'
HTTPie
$ echo '{
  "id" : "431c9d16-a0b9-4b96-ad26-d3af271d02ad",
  "created" : "2018-05-15T00:11:16.530Z",
  "updated" : "2018-05-15T00:11:16.530Z",
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:h2prod", "genie.id:431c9d16-a0b9-4b96-ad26-d3af271d02ad" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "OUT_OF_SERVICE"
}' | http PUT 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 425

{
  "id" : "431c9d16-a0b9-4b96-ad26-d3af271d02ad",
  "created" : "2018-05-15T00:11:16.530Z",
  "updated" : "2018-05-15T00:11:16.530Z",
  "version" : "2.7.1",
  "user" : "genie",
  "name" : "h2prod",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:h2prod", "genie.id:431c9d16-a0b9-4b96-ad26-d3af271d02ad" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "OUT_OF_SERVICE"
}
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.5. Update Parts of a Cluster

8.5.1. Description

Update the metadata about a cluster using JSON Patch. This will ONLY update the fields you request be changed.

For more information about JSON Patch RFC see the website.

8.5.2. Endpoint

PATCH /api/v3/clusters/{id}

8.5.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 33. /api/v3/clusters/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of patches to apply

false

[].op

String

Patch operation to perform.

add, remove, replace, copy, move, test

false

[].path

String

The json path to operate on. e.g. /user

false

[].from

String

The json path to move or copy from. e.g. /user

true

[].value

String

The json value to put at the path for an add, replace or test

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad' -i -X PATCH -H 'Content-Type: application/json;charset=UTF-8' -d '[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "c11cd4f1-3e5e-42e2-bbca-7fffd9ec10be"
} ]'
HTTPie
$ echo '[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "c11cd4f1-3e5e-42e2-bbca-7fffd9ec10be"
} ]' | http PATCH 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PATCH /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 98

[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "c11cd4f1-3e5e-42e2-bbca-7fffd9ec10be"
} ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.6. Delete All Clusters

8.6.1. Description

Delete all the clusters currently stored in the system.

You won’t be able to delete any cluster that has run any job that is still in the system to maintain the ability for users to look up information about their job (where it ran, etc)

8.6.2. Endpoint

DELETE /api/v3/clusters

8.6.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.7. Delete a Cluster

8.7.1. Description

Delete a cluster currently configured in the system.

You won’t be able to delete a cluster that has run any job that is still in the system to maintain the ability for users to look up information about their job (where it ran, etc)

8.7.2. Endpoint

DELETE /api/v3/clusters/{id}

8.7.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 34. /api/v3/clusters/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/99d34eee-e3fc-47cd-be70-0117a8e94aaa' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/99d34eee-e3fc-47cd-be70-0117a8e94aaa'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/99d34eee-e3fc-47cd-be70-0117a8e94aaa HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.8. Get Configs for Cluster

8.8.1. Description

Get the configuration file locations for a cluster.

8.8.2. Endpoint

GET /api/v3/clusters/{id}/configs

8.8.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 35. /api/v3/clusters/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

None

HTTP Messages
Request
GET /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "b772b769-ea9b-4ebf-85ba-ba329caf0277", "2c744315-0e4b-4150-ad2a-753530a7756c" ]

8.9. Add Configs to Cluster

8.9.1. Description

Add configuration file locations to an existing cluster.

Configurations are stored as a set so any duplicates will be ignored.

8.9.2. Endpoint

POST /api/v3/clusters/{id}/configs

8.9.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 36. /api/v3/clusters/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "2c744315-0e4b-4150-ad2a-753530a7756c", "b772b769-ea9b-4ebf-85ba-ba329caf0277" ]'
HTTPie
$ echo '[ "2c744315-0e4b-4150-ad2a-753530a7756c", "b772b769-ea9b-4ebf-85ba-ba329caf0277" ]' | http POST 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "2c744315-0e4b-4150-ad2a-753530a7756c", "b772b769-ea9b-4ebf-85ba-ba329caf0277" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.10. Update Configs for a Cluster

8.10.1. Description

Update the configuration file locations for an existing cluster. Stored as a set so duplicates are ignored.

8.10.2. Endpoint

PUT /api/v3/clusters/{id}/configs

8.10.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 37. /api/v3/clusters/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "481d4ec2-95a8-4a4f-85c6-4a9d3cb71d26" ]'
HTTPie
$ echo '[ "481d4ec2-95a8-4a4f-85c6-4a9d3cb71d26" ]' | http PUT 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "481d4ec2-95a8-4a4f-85c6-4a9d3cb71d26" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.11. Remove All Configs From a Cluster

8.11.1. Description

Remove all the configuration file locations for an existing cluster.

8.11.2. Endpoint

DELETE /api/v3/clusters/{id}/configs

8.11.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 38. /api/v3/clusters/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.12. Get Dependencies For an Cluster

8.12.1. Description

Get the dependency file locations for a cluster.

8.12.2. Endpoint

GET /api/v3/clusters/{id}/dependencies

8.12.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 39. /api/v3/clusters/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

None

HTTP Messages
Request
GET /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "f1b5f7ec-2b29-43ad-9358-af42f90d59c8", "562a4e70-4819-43f8-be83-118b84c1c27f" ]

8.13. Add Dependencies to Cluster

8.13.1. Description

Add dependency file locations to an existing cluster. Stored as a set so all duplicates are ignored.

8.13.2. Endpoint

POST /api/v3/clusters/{id}/dependencies

8.13.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 40. /api/v3/clusters/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "562a4e70-4819-43f8-be83-118b84c1c27f", "f1b5f7ec-2b29-43ad-9358-af42f90d59c8" ]'
HTTPie
$ echo '[ "562a4e70-4819-43f8-be83-118b84c1c27f", "f1b5f7ec-2b29-43ad-9358-af42f90d59c8" ]' | http POST 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "562a4e70-4819-43f8-be83-118b84c1c27f", "f1b5f7ec-2b29-43ad-9358-af42f90d59c8" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.14. Update Dependencies for an Cluster

8.14.1. Description

Update the dependency file locations for an existing cluster

8.14.2. Endpoint

PUT /api/v3/clusters/{id}/dependencies

8.14.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 41. /api/v3/clusters/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "352ec806-acc0-426a-a2c1-a3a34560c609" ]'
HTTPie
$ echo '[ "352ec806-acc0-426a-a2c1-a3a34560c609" ]' | http PUT 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "352ec806-acc0-426a-a2c1-a3a34560c609" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.15. Remove All Dependencies From an Cluster

8.15.1. Description

Remove all the dependency file locations for an existing cluster.

8.15.2. Endpoint

DELETE /api/v3/clusters/{id}/dependencies

8.15.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 42. /api/v3/clusters/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.16. Get Tags For a Cluster

8.16.1. Description

Get the tags for a cluster.

8.16.2. Endpoint

GET /api/v3/clusters/{id}/tags

8.16.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 43. /api/v3/clusters/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

None

HTTP Messages
Request
GET /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 152

[ "genie.name:h2prod", "d1c9217a-da54-4ae8-aba5-a3591e1acf1c", "dbd95c2d-7ffc-433f-b732-b0766f48d278", "genie.id:431c9d16-a0b9-4b96-ad26-d3af271d02ad" ]

8.17. Add Tags to Cluster

8.17.1. Description

Add tags to an existing cluster. Stored as a set so all duplicates are ignored.

genie.id:{id} and genie.name:{name} tags are automatically added by the service.

8.17.2. Endpoint

POST /api/v3/clusters/{id}/tags

8.17.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 44. /api/v3/clusters/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "d1c9217a-da54-4ae8-aba5-a3591e1acf1c", "dbd95c2d-7ffc-433f-b732-b0766f48d278" ]'
HTTPie
$ echo '[ "d1c9217a-da54-4ae8-aba5-a3591e1acf1c", "dbd95c2d-7ffc-433f-b732-b0766f48d278" ]' | http POST 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "d1c9217a-da54-4ae8-aba5-a3591e1acf1c", "dbd95c2d-7ffc-433f-b732-b0766f48d278" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.18. Update Tags for a Cluster

8.18.1. Description

Update the tags for an existing cluster.

The genie.id:{id} and genie.name:{name} tags can’t be removed. They will automatically be added back by the system.

8.18.2. Endpoint

PUT /api/v3/clusters/{id}/tags

8.18.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 45. /api/v3/clusters/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "55c7c92c-0681-42a3-a019-8b329df2c6d9" ]'
HTTPie
$ echo '[ "55c7c92c-0681-42a3-a019-8b329df2c6d9" ]' | http PUT 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "55c7c92c-0681-42a3-a019-8b329df2c6d9" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.19. Remove All Tags From Cluster

8.19.1. Description

Remove all the tags for an existing cluster

The genie.id:{id} and genie.name:{name} tags will NOT be removed by this operation

8.19.2. Endpoint

DELETE /api/v3/clusters/{id}/tags

8.19.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 46. /api/v3/clusters/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.20. Remove Tag From Cluster

8.20.1. Description

Remove a tag from an existing cluster.

You can’t remove the genie.id:{id} and genie.name:{name} tags. They will just be added back by the system

8.20.2. Endpoint

DELETE /api/v3/clusters/{id}/tags/{tag}

8.20.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 47. /api/v3/clusters/{id}/tags/{tag}
Parameter Description

id

The resource id

tag

The tag to remove

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags/3671c280-5d0d-418a-a4e9-0993785e61f6' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags/3671c280-5d0d-418a-a4e9-0993785e61f6'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/tags/3671c280-5d0d-418a-a4e9-0993785e61f6 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.21. Add Commands to a Cluster

8.21.1. Description

Append new commands (as array of their ID’s) to the existing list of commands the cluster can run.

The order of the commands is important. This represents priority order if two commands with same tags match for the given cluster the one earlier in the list will be selected.
The commands for the ID’s must already exist in the system

8.21.2. Endpoint

POST /api/v3/clusters/{id}/commands

8.21.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 48. /api/v3/clusters/{id}/commands
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of command ids (in preferred order) to append to the existing list of commands

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "72b1c305-a787-4a3a-b326-89712f03f2cd", "93009b24-eda6-4239-a6df-d277a264185c" ]'
HTTPie
$ echo '[ "72b1c305-a787-4a3a-b326-89712f03f2cd", "93009b24-eda6-4239-a6df-d277a264185c" ]' | http POST 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "72b1c305-a787-4a3a-b326-89712f03f2cd", "93009b24-eda6-4239-a6df-d277a264185c" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.22. Get the Commands for a Cluster

8.22.1. Description

Get the commands currently linked to the cluster. This indicates the command is able to be run on that cluster.

The order of the commands is important. This represents priority order if two commands with same tags match for the given cluster the one earlier in the list will be selected.

8.22.2. Endpoint

GET /api/v3/clusters/{id}/commands

8.22.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 49. /api/v3/clusters/{id}/commands
Parameter Description

id

The resource id

Query Parameters
Parameter Description

status

The status of commands to search for

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands?status=INACTIVE' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands?status=INACTIVE'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

[]

Array

The list of commands found

false

None

HTTP Messages
Request
GET /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands?status=INACTIVE HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1066

[ {
  "id" : "71f8665c-27a9-490e-a579-f400d679e0b7",
  "created" : "2018-05-15T00:11:11.410Z",
  "updated" : "2018-05-15T00:11:11.410Z",
  "version" : "6d03e6a9-f898-4d64-898c-5229d16ef5dc",
  "user" : "6d03e6a9-f898-4d64-898c-5229d16ef5dc",
  "name" : "6d03e6a9-f898-4d64-898c-5229d16ef5dc",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:71f8665c-27a9-490e-a579-f400d679e0b7", "genie.name:6d03e6a9-f898-4d64-898c-5229d16ef5dc" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "executable" : "6d03e6a9-f898-4d64-898c-5229d16ef5dc",
  "checkDelay" : 1000,
  "memory" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/commands/71f8665c-27a9-490e-a579-f400d679e0b7"
  }, {
    "rel" : "applications",
    "href" : "https://genie.example.com/api/v3/commands/71f8665c-27a9-490e-a579-f400d679e0b7/applications"
  }, {
    "rel" : "clusters",
    "href" : "https://genie.example.com/api/v3/commands/71f8665c-27a9-490e-a579-f400d679e0b7/clusters{?status}"
  } ]
} ]

8.23. Set Commands for a Cluster

8.23.1. Description

Set the commands (as array of their ID’s) that can run on the cluster.

The order of the commands is important. This represents priority order if two commands with same tags match for the given cluster the one earlier in the list will be selected.
The commands for the ID’s must already exist in the system

8.23.2. Endpoint

PUT /api/v3/clusters/{id}/commands

8.23.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 50. /api/v3/clusters/{id}/commands
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of command ids (in preferred order) to replace the existing list of commands

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "0b011d13-9a75-430b-8d6a-ce246ea5c5cc", "00e84ecb-fa02-4511-bc50-35a14e4bf05c" ]'
HTTPie
$ echo '[ "0b011d13-9a75-430b-8d6a-ce246ea5c5cc", "00e84ecb-fa02-4511-bc50-35a14e4bf05c" ]' | http PUT 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "0b011d13-9a75-430b-8d6a-ce246ea5c5cc", "00e84ecb-fa02-4511-bc50-35a14e4bf05c" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.24. Remove All Commands From a Cluster

8.24.1. Description

Remove all the commands currently associated with the given cluster.

This does NOT delete the command(s) from the system just unlinks them

8.24.2. Endpoint

DELETE /api/v3/clusters/{id}/commands

8.24.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 51. /api/v3/clusters/{id}/commands
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

8.25. Remove A Single Command From a Cluster

8.25.1. Description

Remove the identified command from the cluster.

This does NOT delete the command from the system just unlinks it

8.25.2. Endpoint

DELETE /api/v3/clusters/{id}/commands/{commandId}

8.25.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 52. /api/v3/clusters/{id}/commands/{commandId}
Parameter Description

id

The resource id

commandId

The id of the command to remove

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands/c155fa2a-48ff-4ef9-a6d7-64509495acfa' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands/c155fa2a-48ff-4ef9-a6d7-64509495acfa'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/clusters/431c9d16-a0b9-4b96-ad26-d3af271d02ad/commands/c155fa2a-48ff-4ef9-a6d7-64509495acfa HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9. Commands API

9.1. Create a Command

9.1.1. Description

Create a new command in the system.

9.1.2. Endpoint

POST /api/v3/commands

The id in this example is optional. If you include one Genie will use it. If not it will provide one. If you provide one it must be unique.

9.1.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters

None

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the command. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

executable

String

The executable to run on the Genie node when this command is used. e.g. /usr/bin/hadoop

Must not be empty. Size must be between 0 and 255 inclusive

false

checkDelay

Number

The amount of time (in milliseconds) to delay between checks of the jobs using this command

Must be at least 1

false

memory

Number

The default amount of memory (in MB) that should be allocated for instances of this command client

Must be at least 1

true

dependencies

Array

The dependencies for the command

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : "Hive command v1.0.0",
  "metadata" : null,
  "tags" : [ "tag:bar", "tag:foo" ],
  "configs" : [ "s3:///path/to/config-foo", "s3:///path/to/config-bar" ],
  "dependencies" : [ "/path/to/file/foo", "/path/to/file/bar" ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : 1024
}'
HTTPie
$ echo '{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : "Hive command v1.0.0",
  "metadata" : null,
  "tags" : [ "tag:bar", "tag:foo" ],
  "configs" : [ "s3:///path/to/config-foo", "s3:///path/to/config-bar" ],
  "dependencies" : [ "/path/to/file/foo", "/path/to/file/bar" ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : 1024
}' | http POST 'https://genie.example.com/api/v3/commands' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers
Name Description

Location

The URI

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/commands HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 485

{
  "id" : null,
  "created" : null,
  "updated" : null,
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : "Hive command v1.0.0",
  "metadata" : null,
  "tags" : [ "tag:bar", "tag:foo" ],
  "configs" : [ "s3:///path/to/config-foo", "s3:///path/to/config-bar" ],
  "dependencies" : [ "/path/to/file/foo", "/path/to/file/bar" ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : 1024
}
Response
HTTP/1.1 201 Created
X-Application-Context: genie:integration,db,db-h2:0
Location: https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e

9.2. Get a Command

9.2.1. Description

Get the metadata about a command in the system.

9.2.2. Endpoint

GET /api/v3/commands/{id}

9.2.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 53. /api/v3/commands/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the command. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

executable

String

The executable to run on the Genie node when this command is used. e.g. /usr/bin/hadoop

Must not be empty. Size must be between 0 and 255 inclusive

false

checkDelay

Number

The amount of time (in milliseconds) to delay between checks of the jobs using this command

Must be at least 1

false

memory

Number

The default amount of memory (in MB) that should be allocated for instances of this command client

Must be at least 1

true

dependencies

Array

The dependencies for the command

true

Relation Description

self

URI for this command

applications

Get all the applications this command depends on

clusters

Get all clusters this command is available on

HTTP Messages
Request
GET /api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1073

{
  "id" : "6cbc20ea-794a-45a1-b7d2-1af157db255e",
  "created" : "2018-05-15T00:11:21.059Z",
  "updated" : "2018-05-15T00:11:21.059Z",
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : "Hive command v1.0.0",
  "metadata" : null,
  "tags" : [ "tag:bar", "tag:foo", "genie.name:hive", "genie.id:6cbc20ea-794a-45a1-b7d2-1af157db255e" ],
  "configs" : [ "s3:///path/to/config-foo", "s3:///path/to/config-bar" ],
  "dependencies" : [ "/path/to/file/foo", "/path/to/file/bar" ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : 1024,
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e"
    },
    "applications" : {
      "href" : "https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e/applications"
    },
    "clusters" : {
      "href" : "https://genie.example.com/api/v3/commands/6cbc20ea-794a-45a1-b7d2-1af157db255e/clusters{?status}",
      "templated" : true
    }
  }
}

9.3. Find Commands

9.3.1. Description

Find commands using various query parameters.

9.3.2. Endpoint

GET /api/v3/commands

9.3.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters
Parameter Description

page

The page number to get. Default to 0.

size

The size of the page to get. Default to 64.

sort

The fields to sort the results by. Defaults to 'updated,desc'.

name

The name of the commands to find. Use % to perform a regex like query

user

The user of the commands to find. Use % to perform a regex like query

status

The status(es) of the commands to find. Can have multiple. Options: [ACTIVE, DEPRECATED, INACTIVE]

tag

The tag(s) of the commands to find. Can have multiple.

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands?status=ACTIVE&status=INACTIVE' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands?status=ACTIVE&status=INACTIVE'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

_links

Object

Links to other resources.

false

page

Object

The result page information.

false

page.size

Number

The number of elements in this page result.

false

page.totalElements

Number

The total number of elements this search result could return.

false

page.totalPages

Number

The total number of pages there could be at the current page size.

false

page.number

Number

The current page number.

false

_embedded.commandList

Array

The found commands.

false

Relation Description

self

The current search

first

The first page for this search

prev

The previous page for this search

next

The next page for this search

last

The last page for this search

HTTP Messages
Request
GET /api/v3/commands?status=ACTIVE&status=INACTIVE HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 2719

{
  "_embedded" : {
    "commandList" : [ {
      "id" : "f207b744-ed96-4871-b3ad-527648f6afd4",
      "created" : "2018-05-15T00:11:19.486Z",
      "updated" : "2018-05-15T00:11:19.486Z",
      "version" : "28ec38e6-6e8a-478e-a1de-1805e495efc2",
      "user" : "dc796656-6a02-47e8-948a-a0e7fe4da877",
      "name" : "d6232d70-f2a2-4acc-8bf0-93ba25e8a122",
      "description" : null,
      "metadata" : null,
      "tags" : [ "genie.name:d6232d70-f2a2-4acc-8bf0-93ba25e8a122", "genie.id:f207b744-ed96-4871-b3ad-527648f6afd4" ],
      "configs" : [ ],
      "dependencies" : [ ],
      "setupFile" : null,
      "status" : "INACTIVE",
      "executable" : "9f609431-855e-4f47-b596-f1005f8c0ea9",
      "checkDelay" : 10000,
      "memory" : null,
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/commands/f207b744-ed96-4871-b3ad-527648f6afd4"
        },
        "applications" : {
          "href" : "https://genie.example.com/api/v3/commands/f207b744-ed96-4871-b3ad-527648f6afd4/applications"
        },
        "clusters" : {
          "href" : "https://genie.example.com/api/v3/commands/f207b744-ed96-4871-b3ad-527648f6afd4/clusters{?status}",
          "templated" : true
        }
      }
    }, {
      "id" : "8a32ca05-79f3-4686-b14f-0ae9ba9940ee",
      "created" : "2018-05-15T00:11:17.443Z",
      "updated" : "2018-05-15T00:11:17.443Z",
      "version" : "6c78f6d7-9caf-4896-8e17-f7304bde39cb",
      "user" : "1708dae5-3089-4f95-b0a3-93e91548a0c7",
      "name" : "f73cbe91-3735-4b49-8265-33d8c5e56df6",
      "description" : null,
      "metadata" : null,
      "tags" : [ "genie.name:f73cbe91-3735-4b49-8265-33d8c5e56df6", "genie.id:8a32ca05-79f3-4686-b14f-0ae9ba9940ee" ],
      "configs" : [ ],
      "dependencies" : [ ],
      "setupFile" : null,
      "status" : "ACTIVE",
      "executable" : "bd3d3733-a966-42b0-96a6-4d76907380b7",
      "checkDelay" : 10000,
      "memory" : null,
      "_links" : {
        "self" : {
          "href" : "https://genie.example.com/api/v3/commands/8a32ca05-79f3-4686-b14f-0ae9ba9940ee"
        },
        "applications" : {
          "href" : "https://genie.example.com/api/v3/commands/8a32ca05-79f3-4686-b14f-0ae9ba9940ee/applications"
        },
        "clusters" : {
          "href" : "https://genie.example.com/api/v3/commands/8a32ca05-79f3-4686-b14f-0ae9ba9940ee/clusters{?status}",
          "templated" : true
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://genie.example.com/api/v3/commands?status=ACTIVE&status=INACTIVE{&name,user,tag}",
      "templated" : true
    }
  },
  "page" : {
    "size" : 64,
    "totalElements" : 2,
    "totalPages" : 1,
    "number" : 0
  }
}

9.4. Update an Entire Command

9.4.1. Description

Update the metadata about a command. This method does a complete replace of the resource. Usual flow is to call to get the most recent state then update what you want and call this API with the result.

For more fine grained control call the PATCH API.

9.4.2. Endpoint

PUT /api/v3/commands/{id}

9.4.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 54. /api/v3/commands/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

id

String

The id. If not set the system will set one.

Size must be between 0 and 255 inclusive

true

created

String

The UTC time of creation. Set by system. ISO8601 format including milliseconds.

true

updated

String

The UTC time of last update. Set by system. ISO8601 format including milliseconds.

true

name

String

The name

Must not be empty. Size must be between 0 and 255 inclusive

false

user

String

The user

Must not be empty. Size must be between 0 and 255 inclusive

false

version

String

The version

Must not be empty. Size must be between 0 and 255 inclusive

false

description

String

Any description

Size must be between 0 and 1000 inclusive

true

metadata

Object

Any semi-structured metadata. Must be valid JSON

true

tags

Array

The tags

true

setupFile

String

A location for any setup that needs to be done when installing

Size must be between 0 and 1024 inclusive

true

configs

Array

Any configuration files needed for the resource

true

status

String

The status of the command. Options: [ACTIVE, DEPRECATED, INACTIVE]

Must not be null

false

executable

String

The executable to run on the Genie node when this command is used. e.g. /usr/bin/hadoop

Must not be empty. Size must be between 0 and 255 inclusive

false

checkDelay

Number

The amount of time (in milliseconds) to delay between checks of the jobs using this command

Must be at least 1

false

memory

Number

The default amount of memory (in MB) that should be allocated for instances of this command client

Must be at least 1

true

dependencies

Array

The dependencies for the command

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '{
  "id" : "59c7c73c-1c1c-4b5e-9be2-e1d8b885685a",
  "created" : "2018-05-15T00:11:21.526Z",
  "updated" : "2018-05-15T00:11:21.526Z",
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:59c7c73c-1c1c-4b5e-9be2-e1d8b885685a", "genie.name:hive" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : null
}'
HTTPie
$ echo '{
  "id" : "59c7c73c-1c1c-4b5e-9be2-e1d8b885685a",
  "created" : "2018-05-15T00:11:21.526Z",
  "updated" : "2018-05-15T00:11:21.526Z",
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:59c7c73c-1c1c-4b5e-9be2-e1d8b885685a", "genie.name:hive" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : null
}' | http PUT 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 498

{
  "id" : "59c7c73c-1c1c-4b5e-9be2-e1d8b885685a",
  "created" : "2018-05-15T00:11:21.526Z",
  "updated" : "2018-05-15T00:11:21.526Z",
  "version" : "1.0.0",
  "user" : "genie",
  "name" : "hive",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:59c7c73c-1c1c-4b5e-9be2-e1d8b885685a", "genie.name:hive" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "INACTIVE",
  "executable" : "/apps/hive/bin/hive",
  "checkDelay" : 10000,
  "memory" : null
}
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.5. Update Parts of a Command

9.5.1. Description

Update the metadata about a command using JSON Patch. This will ONLY update the fields you request be changed.

For more information about JSON Patch RFC see the website.

9.5.2. Endpoint

PATCH /api/v3/commands/{id}

9.5.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 55. /api/v3/commands/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of patches to apply

false

[].op

String

Patch operation to perform.

add, remove, replace, copy, move, test

false

[].path

String

The json path to operate on. e.g. /user

false

[].from

String

The json path to move or copy from. e.g. /user

true

[].value

String

The json value to put at the path for an add, replace or test

true

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a' -i -X PATCH -H 'Content-Type: application/json;charset=UTF-8' -d '[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "e2d9a0ef-fed1-42a2-b70e-5d5deb710e53"
} ]'
HTTPie
$ echo '[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "e2d9a0ef-fed1-42a2-b70e-5d5deb710e53"
} ]' | http PATCH 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PATCH /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 98

[ {
  "op" : "replace",
  "path" : "/name",
  "value" : "e2d9a0ef-fed1-42a2-b70e-5d5deb710e53"
} ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.6. Delete All Commands

9.6.1. Description

Delete all the commands currently stored in the system.

You won’t be able to delete any command that has been used by any job that is still in the system to maintain the ability for users to look up information about their job (where it ran, what it ran, etc)

9.6.2. Endpoint

DELETE /api/v3/commands

9.6.3. API Docs

Request Documentation
Headers

None

Path Parameters

None

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.7. Delete a Command

9.7.1. Description

Delete a command currently configured in the system.

You won’t be able to delete a command that has been used by any job that is still in the system to maintain the ability for users to look up information about their job (where it ran, what it ran, etc)

9.7.2. Endpoint

DELETE /api/v3/commands/{id}

9.7.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 56. /api/v3/commands/{id}
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/2c684a60-7eb7-47f7-bc71-ce82d3f5eec6' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/2c684a60-7eb7-47f7-bc71-ce82d3f5eec6'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/2c684a60-7eb7-47f7-bc71-ce82d3f5eec6 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.8. Get Configs for Command

9.8.1. Description

Get the configuration file locations for a command.

9.8.2. Endpoint

GET /api/v3/commands/{id}/configs

9.8.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 57. /api/v3/commands/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

None

HTTP Messages
Request
GET /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "681d2644-08f4-4dde-8094-1f895eb3f283", "3103a619-7dde-446f-bd47-75eb3b04e2ef" ]

9.9. Add Configs to Command

9.9.1. Description

Add configuration file locations to an existing command.

Configurations are stored as a set so any duplicates will be ignored.

9.9.2. Endpoint

POST /api/v3/commands/{id}/configs

9.9.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 58. /api/v3/commands/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "681d2644-08f4-4dde-8094-1f895eb3f283", "3103a619-7dde-446f-bd47-75eb3b04e2ef" ]'
HTTPie
$ echo '[ "681d2644-08f4-4dde-8094-1f895eb3f283", "3103a619-7dde-446f-bd47-75eb3b04e2ef" ]' | http POST 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "681d2644-08f4-4dde-8094-1f895eb3f283", "3103a619-7dde-446f-bd47-75eb3b04e2ef" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.10. Update Configs for a Command

9.10.1. Description

Update the configuration file locations for an existing command. Stored as a set so duplicates are ignored.

9.10.2. Endpoint

PUT /api/v3/commands/{id}/configs

9.10.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 59. /api/v3/commands/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of configuration file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "2b6d70cc-6f6e-47e9-9373-157f10743e48" ]'
HTTPie
$ echo '[ "2b6d70cc-6f6e-47e9-9373-157f10743e48" ]' | http PUT 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "2b6d70cc-6f6e-47e9-9373-157f10743e48" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.11. Remove All Configs From a Command

9.11.1. Description

Remove all the configuration file locations for an existing command.

9.11.2. Endpoint

DELETE /api/v3/commands/{id}/configs

9.11.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 60. /api/v3/commands/{id}/configs
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/configs HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.12. Get Dependencies For an Command

9.12.1. Description

Get the dependency file locations for an command.

9.12.2. Endpoint

GET /api/v3/commands/{id}/dependencies

9.12.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 61. /api/v3/commands/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

None

HTTP Messages
Request
GET /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 82

[ "4a58eef8-c4ac-4a29-a46f-1c200c78fe13", "e02c8537-aea9-404a-8a3f-d9f08b40ed3f" ]

9.13. Add Dependencies to Command

9.13.1. Description

Add dependency file locations to an existing command. Stored as a set so all duplicates are ignored.

9.13.2. Endpoint

POST /api/v3/commands/{id}/dependencies

9.13.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 62. /api/v3/commands/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "4a58eef8-c4ac-4a29-a46f-1c200c78fe13", "e02c8537-aea9-404a-8a3f-d9f08b40ed3f" ]'
HTTPie
$ echo '[ "4a58eef8-c4ac-4a29-a46f-1c200c78fe13", "e02c8537-aea9-404a-8a3f-d9f08b40ed3f" ]' | http POST 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "4a58eef8-c4ac-4a29-a46f-1c200c78fe13", "e02c8537-aea9-404a-8a3f-d9f08b40ed3f" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.14. Update Dependencies for an Command

9.14.1. Description

Update the dependency file locations for an existing command

9.14.2. Endpoint

PUT /api/v3/commands/{id}/dependencies

9.14.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 63. /api/v3/commands/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of dependency file locations

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "3e3bd28d-2cbe-40ae-beb3-0c36b2e14408" ]'
HTTPie
$ echo '[ "3e3bd28d-2cbe-40ae-beb3-0c36b2e14408" ]' | http PUT 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "3e3bd28d-2cbe-40ae-beb3-0c36b2e14408" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.15. Remove All Dependencies From an Command

9.15.1. Description

Remove all the dependency file locations for an existing command.

9.15.2. Endpoint

DELETE /api/v3/commands/{id}/dependencies

9.15.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 64. /api/v3/commands/{id}/dependencies
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/dependencies HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.16. Get Tags For a Command

9.16.1. Description

Get the tags for a command.

9.16.2. Endpoint

GET /api/v3/commands/{id}/tags

9.16.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 65. /api/v3/commands/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags'
Response Documentation
Headers
Name Description

Content-Type

application/json

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

None

HTTP Messages
Request
GET /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/json;charset=UTF-8
Content-Length: 150

[ "36132f89-f1b0-4a19-b867-e92a9f25c67f", "2ea0457b-b62e-47da-a7c6-661b705ea2df", "genie.id:59c7c73c-1c1c-4b5e-9be2-e1d8b885685a", "genie.name:hive" ]

9.17. Add Tags to Command

9.17.1. Description

Add tags to an existing command. Stored as a set so all duplicates are ignored.

genie.id:{id} and genie.name:{name} tags are automatically added by the service.

9.17.2. Endpoint

POST /api/v3/commands/{id}/tags

9.17.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 66. /api/v3/commands/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "36132f89-f1b0-4a19-b867-e92a9f25c67f", "2ea0457b-b62e-47da-a7c6-661b705ea2df" ]'
HTTPie
$ echo '[ "36132f89-f1b0-4a19-b867-e92a9f25c67f", "2ea0457b-b62e-47da-a7c6-661b705ea2df" ]' | http POST 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "36132f89-f1b0-4a19-b867-e92a9f25c67f", "2ea0457b-b62e-47da-a7c6-661b705ea2df" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.18. Update Tags for a Command

9.18.1. Description

Update the tags for an existing command.

The genie.id:{id} and genie.name:{name} tags can’t be removed. They will automatically be added back by the system.

9.18.2. Endpoint

PUT /api/v3/commands/{id}/tags

9.18.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 67. /api/v3/commands/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of tags

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "4197fcd3-b1b2-4d6c-b1d9-d1a2493d5f9f" ]'
HTTPie
$ echo '[ "4197fcd3-b1b2-4d6c-b1d9-d1a2493d5f9f" ]' | http PUT 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 42

[ "4197fcd3-b1b2-4d6c-b1d9-d1a2493d5f9f" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.19. Remove All Tags From Command

9.19.1. Description

Remove all the tags for an existing command

The genie.id:{id} and genie.name:{name} tags will NOT be removed by this operation

9.19.2. Endpoint

DELETE /api/v3/commands/{id}/tags

9.19.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 68. /api/v3/commands/{id}/tags
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.20. Remove Tag From Command

9.20.1. Description

Remove a tag from an existing command.

You can’t remove the genie.id:{id} and genie.name:{name} tags. They will just be added back by the system

9.20.2. Endpoint

DELETE /api/v3/commands/{id}/tags/{tag}

9.20.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 69. /api/v3/commands/{id}/tags/{tag}
Parameter Description

id

The resource id

tag

The tag to remove

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags/07f7ac7c-4c94-4265-b232-62464d9faa39' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags/07f7ac7c-4c94-4265-b232-62464d9faa39'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/tags/07f7ac7c-4c94-4265-b232-62464d9faa39 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.21. Add Applications to a Command

9.21.1. Description

Add new applications (as array of their ID’s) to the existing set of applications the command depends on

The applications for the ID’s must already exist in the system

9.21.2. Endpoint

POST /api/v3/commands/{id}/applications

9.21.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 70. /api/v3/commands/{id}/applications
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of application ids to add to existing set of applications

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' -i -X POST -H 'Content-Type: application/json;charset=UTF-8' -d '[ "a01d73b0-f775-4106-9a33-312c4dfe870e", "1879eaf7-0e36-480c-ad8c-d412424b2938" ]'
HTTPie
$ echo '[ "a01d73b0-f775-4106-9a33-312c4dfe870e", "1879eaf7-0e36-480c-ad8c-d412424b2938" ]' | http POST 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
POST /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "a01d73b0-f775-4106-9a33-312c4dfe870e", "1879eaf7-0e36-480c-ad8c-d412424b2938" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.22. Get the Applications for a Command

9.22.1. Description

Get the applications the command currently depends on. These are the applications that will be installed at runtime when a job is run with the given command

9.22.2. Endpoint

GET /api/v3/commands/{id}/applications

9.22.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 71. /api/v3/commands/{id}/applications
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

[]

Array

The set of applications this command depends on

false

None

HTTP Messages
Request
GET /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 2540

[ {
  "id" : "a01d73b0-f775-4106-9a33-312c4dfe870e",
  "created" : "2018-05-15T00:11:20.118Z",
  "updated" : "2018-05-15T00:11:20.118Z",
  "version" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "user" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "name" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:a01d73b0-f775-4106-9a33-312c4dfe870e", "genie.name:2b22d8e1-3595-458a-a7dc-5a6fe3a367ae" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "type" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/applications/a01d73b0-f775-4106-9a33-312c4dfe870e"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/applications/a01d73b0-f775-4106-9a33-312c4dfe870e/commands{?status}"
  } ]
}, {
  "id" : "1879eaf7-0e36-480c-ad8c-d412424b2938",
  "created" : "2018-05-15T00:11:20.130Z",
  "updated" : "2018-05-15T00:11:20.130Z",
  "version" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "user" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "name" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.id:1879eaf7-0e36-480c-ad8c-d412424b2938", "genie.name:2b22d8e1-3595-458a-a7dc-5a6fe3a367ae" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "type" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/applications/1879eaf7-0e36-480c-ad8c-d412424b2938"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/applications/1879eaf7-0e36-480c-ad8c-d412424b2938/commands{?status}"
  } ]
}, {
  "id" : "4fbfd10c-22ba-4f93-9183-81cd2ec89a6b",
  "created" : "2018-05-15T00:11:20.192Z",
  "updated" : "2018-05-15T00:11:20.192Z",
  "version" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "user" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "name" : "2b22d8e1-3595-458a-a7dc-5a6fe3a367ae",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:2b22d8e1-3595-458a-a7dc-5a6fe3a367ae", "genie.id:4fbfd10c-22ba-4f93-9183-81cd2ec89a6b" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "ACTIVE",
  "type" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/applications/4fbfd10c-22ba-4f93-9183-81cd2ec89a6b"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/applications/4fbfd10c-22ba-4f93-9183-81cd2ec89a6b/commands{?status}"
  } ]
} ]

9.23. Set Applications for a Command

9.23.1. Description

Set the applications (as array of their ID’s) that are dependencies of the command.

The applications with the ID’s must already exist in the system

9.23.2. Endpoint

PUT /api/v3/commands/{id}/applications

9.23.3. API Docs

Request Documentation
Headers
Name Description

Content-Type

application/json

Path Parameters
Table 72. /api/v3/commands/{id}/applications
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields
Path Type Description Constraints Optional

[]

Array

Array of application ids to replace the existing set of applications with

false

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' -i -X PUT -H 'Content-Type: application/json;charset=UTF-8' -d '[ "8c341914-de62-4e90-8438-11b925092e61", "8fb21863-6424-4c46-ab91-754a3c49e294" ]'
HTTPie
$ echo '[ "8c341914-de62-4e90-8438-11b925092e61", "8fb21863-6424-4c46-ab91-754a3c49e294" ]' | http PUT 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' 'Content-Type:application/json;charset=UTF-8'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
PUT /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: genie.example.com
Content-Length: 82

[ "8c341914-de62-4e90-8438-11b925092e61", "8fb21863-6424-4c46-ab91-754a3c49e294" ]
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.24. Remove All Applications From a Command

9.24.1. Description

Remove all the applications currently set as dependencies of the command

This does NOT delete the application(s) from the system just unlinks them

9.24.2. Endpoint

DELETE /api/v3/commands/{id}/applications

9.24.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 73. /api/v3/commands/{id}/applications
Parameter Description

id

The resource id

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.25. Remove A Single Application From a Command

9.25.1. Description

Remove the identified application as a dependency of the command.

This does NOT delete the application from the system just un-links it

9.25.2. Endpoint

DELETE /api/v3/commands/{id}/applications/{applicationId}

9.25.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 74. /api/v3/commands/{id}/applications/{applicationId}
Parameter Description

id

The resource id

applicationId

The id of the application to remove

Query Parameters

None

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications/f9b385bf-8a01-4aa5-b1fb-5066613f9534' -i -X DELETE
HTTPie
$ http DELETE 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications/f9b385bf-8a01-4aa5-b1fb-5066613f9534'
Response Documentation
Headers

None

Payload Fields

None

None

HTTP Messages
Request
DELETE /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/applications/f9b385bf-8a01-4aa5-b1fb-5066613f9534 HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 204 No Content
X-Application-Context: genie:integration,db,db-h2:0

9.26. Get the Clusters that Have Command Available

9.26.1. Description

Search the clusters that the given command is linked to.

9.26.2. Endpoint

GET /api/v3/applications/{id}/commands

9.26.3. API Docs

Request Documentation
Headers

None

Path Parameters
Table 75. /api/v3/commands/{id}/clusters
Parameter Description

id

The resource id

Query Parameters
Parameter Description

status

The status of clusters to search for

Payload Fields

None

Request Examples
cURL
$ curl 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/clusters?status=UP' -i
HTTPie
$ http GET 'https://genie.example.com/api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/clusters?status=UP'
Response Documentation
Headers
Name Description

Content-Type

application/hal+json

Payload Fields
Path Type Description Constraints Optional

[]

Array

The list of clusters found

false

None

HTTP Messages
Request
GET /api/v3/commands/59c7c73c-1c1c-4b5e-9be2-e1d8b885685a/clusters?status=UP HTTP/1.1
Host: genie.example.com
Response
HTTP/1.1 200 OK
X-Application-Context: genie:integration,db,db-h2:0
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 819

[ {
  "id" : "6712f9b4-8cb2-4dc4-939f-6837a9f733c4",
  "created" : "2018-05-15T00:11:20.723Z",
  "updated" : "2018-05-15T00:11:20.766Z",
  "version" : "1ae7bb67-710f-4c4f-86d1-709330e366fd",
  "user" : "1ae7bb67-710f-4c4f-86d1-709330e366fd",
  "name" : "1ae7bb67-710f-4c4f-86d1-709330e366fd",
  "description" : null,
  "metadata" : null,
  "tags" : [ "genie.name:1ae7bb67-710f-4c4f-86d1-709330e366fd", "genie.id:6712f9b4-8cb2-4dc4-939f-6837a9f733c4" ],
  "configs" : [ ],
  "dependencies" : [ ],
  "setupFile" : null,
  "status" : "UP",
  "links" : [ {
    "rel" : "self",
    "href" : "https://genie.example.com/api/v3/clusters/6712f9b4-8cb2-4dc4-939f-6837a9f733c4"
  }, {
    "rel" : "commands",
    "href" : "https://genie.example.com/api/v3/clusters/6712f9b4-8cb2-4dc4-939f-6837a9f733c4/commands{?status}"
  } ]
} ]