/chefapi_client_nodes

Get node information from a chef server

Primary LanguageGoApache License 2.0Apache-2.0

chefapi_client_nodes

This code provides a go client interface to the chefapic to interact with nodes. Running this code provides a simpler API than the native chef REST API for use by web applications. See the chefapi_demo_server repository to see how this code was installed and started.

Front End Endpoints used by web applications


GET /orgnodes

===========================

Request

Filter values may restrict the returned information to a specific owner of the nodes and to a specific organization. If not set nodes for all users and/or all organizations will be returned.

Return

The body returned looks like this:

{
  "organization": [
     "node1",
     "node2"
   ]
}

Values

  • 200 - List returned
  • 400 - Invalid request was made
  • 403 - Unauthorized request was made

GET /orgnodes/ORG/nodes/NODE

===========================

Request

No request body is used

Return

The body returned looks like this:

{
  "name": "node_name",
  "chef_environment": "_default",
  "run_list": [
    "recipe[recipe_name]"
  ]
  "json_class": "Chef::Node",
  "chef_type": "node",
  "automatic": { ... },
  "normal": { "tags": [ ] },
  "default": { },
  "override": { }
}

Values

  • 200 - Node data returned
  • 400 - Invalid request was made
  • 403 - Unauthorized request was made

PUT /orgnodes/ORG/nodes/NODE

===========================

Request

The request body looks like this:

{
  "name": "node_name",
  "chef_environment": "_default",
  "run_list": [
    "recipe[recipe_name]"
  ]
  "json_class": "Chef::Node",
  "chef_type": "node",
  "automatic": { ... },
  "normal": { "tags": [ ] },
  "default": { },
  "override": { }
}

Return

No JSON body is returned.

Values

  • 200 - Node data returned
  • 400 - Invalid request was made
  • 403 - Unauthorized request was made

Back End Chef Infra Server Endpoints used


GET /orgnodes/ORG/nodes

GET /orgnodes/ORG/nodes/NODE

PUT /orgnodes/ORG/nodes/NODE

Links