Plans endpoints
Use the plans
endpoints to get information about plans.
GET /plans
Lists all known plans in a specific environment.
Request format
production
environment, such
as:https://orchestrator.example.com:8143/orchestrator/v1/plans
For
any other environments, you must use the environment
parameter to specify the environment whose plans you want to query. For example, this
request queries plans in the development
environment:https://orchestrator.example.com:8143/orchestrator/v1/plans?environment=development
Response format
The response is a JSON object containing an environment
object and a items
array.
environment
object contains these keys:-
name
: The environment specified in the request. -
code_id
: Eithernull
or a unique string. Puppet Server uses thecode_id
to retrieve the version of file resources in an environment at the time when a catalog was compiled. You can learn more aboutcode_id
in the Puppet Static catalogs documentation.
items
array contains one JSON object for each plan in
the environment. Each plan object uses these keys:Key | Definition |
---|---|
id |
A URI path you can use with the GET /plans/<module>/<plan-name> endpoint to learn more about the plan. |
name |
The plan's name. You can use this with, for example, the POST /command/plan_run endpoint. |
permitted |
A Boolean indicating if you are permitted to run the plan. |
production
environment:{
"environment": {
"name": "production",
"code_id": null
},
"items": [
{
"id": "https://orchestrator.example.com:8143/orchestrator/v1/plans/profile/firewall",
"name": "profile::firewall",
"permitted": true
},
{
"id": "https://orchestrator.example.com:8143/orchestrator/v1/plans/profile/rolling_update",
"name": "profile::rolling_update",
"permitted": true
},
{
"id": "https://orchestrator.example.com:8143/orchestrator/v1/plans/canary/random",
"name": "canary::random",
"permitted": false
}
]
}
Error responses
kind
key:Response code | Key | Description |
---|---|---|
400 | puppetlabs.orchestrator/validation-error |
The environment parameter does not supply a legal
environment name. For example, the name is not a string or contains illegal
characters. |
404 | puppetlabs.orchestrator/unknown-environment |
No environment exists that matches the specified environment. |
GET /plans/<module>/<plan-name>
Get information about a specific plan, including metadata. This endpoint provides more
information than the GET /plans
endpoint.
Request format
GET "https://orchestrator.example.com:8143/orchestrator/v1/plans/profile/firewall"
Use
the GET /plans endpoint to get module and plan
names.environment
parameter to retrieve details about the plan in a specific
environment. If you do not specify this parameter, the endpoint uses the default value,
which is production
. For example, this request retrieves
details about the firewall
plan in the development
environment:GET "https://orchestrator.example.com:8143/orchestrator/v1/plans/profile/firewall?environment=development"
Response format
Key | Definition |
---|---|
id |
The URI path identifying the module and plan, as supplied in the request. |
name |
The plan's name. You can use this with, for example, the POST /command/plan_run endpoint. |
environment |
A JSON object containing the name of the
environment specified in the request and the code_id .The |
metadata |
A JSON object that can be empty or contain a description of the plan and a parameters JSON object.The
parameters object, if present, can use these keys:
|
permitted |
A Boolean indicating if you are permitted to run the plan. |
{
"id": "https://orchestrator.example.com:8143/orchestrator/v1/plans/package/install",
"name": "canary::random",
"environment": {
"name": "production",
"code_id": null
},
"metadata": {},
"permitted": true
}
Error responses
kind
key:Response code | Key | Description |
---|---|---|
400 | puppetlabs.orchestrator/validation-error |
There is a problem with the format of the module name, plan name, or
environment parameter in the request. For example, one of the
values contains illegal characters. |
404 | puppetlabs.orchestrator/unknown-environment |
No environment exists that matches the specified environment. |
404 | puppetlabs.orchestrator/unknown-plan |
The endpoint can't find a match for the specified plan. There are several
possible reasons for this, including:
For example, a plan that only exists in the |