This API is based off the Hiera http-backend. More information about the Hiera backend can be found here.
A Hiera object in SIS has the following schema definition:
{
// The name of the hiera entry. This could be a fqdn, environment, etc.
// Required and unique string.
"name" : { "type" : "String", "required" : true, "unique" : true },
"_sis" : {
// The owner groups of the schema
// See [Role Based Access Control](./docs/rbac.md)
"owner" : { "type" : ["String"] }
},
// The actual key value pairs associated with the entry
"hieradata" : { "type" : "Mixed", "required" : true }
}An example Hiera object is below:
{
"name" : "sample.env",
"_sis" : { "owner" : ["SISG1"] },
"hieradata" : {
"port" : 1000,
"num_instances" : 1,
"db_host" : "db.sample.env"
}
}The hieradata object can be anything provided the values are JSON friendly.
GET /api/v1.1/hiera- returns a list of hiera entriesGET /api/v1.1/hiera/:name- returns a hash with a single key value pair as a hash where the key is the supplied:nameparameter and the value is hieradata value of the object. For instance, using the above example, the result ofGET /api/v1.1/hiera/sample.envwould be:
{
"sample.env" : {
"port" : 1000,
"num_instances" : 1,
"db_host" : "db.sample.env"
}
}POST /api/v1.1/hiera
The request body must be a valid hiera object as defined above. This method will error if an entry with the same name exists.
The response is the full hiera object.
Error cases:
- An entry with the same name already exists.
- Authorization failure
PUT /api/v1.1/hiera/:name
The request body must be a valid entry object. The name in the object must match the name in the path parameter.
Partial updates are supported.
The response is the updated hiera entry object.
Error cases:
- The name in the payload does not match the name in the path.
- The entry does not exist
- Authorization failure
_sis.immutableis true
DELETE /api/v1.1/hiera/:name
Deletes the heira entry with the specified name or errors.
The response contains the deleted entry.
Error cases:
- The entry does not exist
- Authorization failure
_sis.lockedis true