cheflib.entities package¶
Submodules¶
cheflib.entities.base module¶
Chef base entity.
- class cheflib.entities.base.Entity(_chef: 'Chef', _name: str, _url: str, _data: Dict | None = None)[source]¶
Bases:
object- property data¶
- property name¶
cheflib.entities.client module¶
Chef client entity.
GET: /organizations/NAME/clients This method has no request body. Response: {
“org1-validator” : “https://chef.example/orgaizations/org1/clients/org1-validator”, “client1” : “https://chef.example/orgaizations/org1/clients/client1”
}
POST: /organizations/NAME/clients Body: {
“name”: “name_of_API_client”, “clientname”: “name_of_API_client”, “validator”: true, “create_key”: true
}
DELETE: /organizations/NAME/clients/NAME This method has no request body. The response has no body.
GET: /organizations/NAME/clients/NAME This method has no request body. Response: {
“name”: “user1”, “clientname”: “user1”, “orgname”: “test”, “json_class”: “Chef::ApiClient”, “chef_type”: “client”, “validator”: “false”
}
PUT: /organizations/NAME/clients/NAME with a request body similar to: {
“name”: “monkeypants”, “validator”: false
} The response is similar to: {
“name”: “monkeypants”, “clientname”: “monkeypants”, “validator”: true, “json_class”:”Chef::ApiClient”, “chef_type”:”client”
}
cheflib.entities.client_key module¶
Chef client key entity.
GET: /organizations/NAME/clients/NAME/keys This method has no request body. Response: {
“org1-validator” : “https://chef.example/orgaizations/org1/clients/org1-validator”, “client1” : “https://chef.example/orgaizations/org1/clients/client1”
}
POST: /organizations/NAME/clients Body: {
“name”: “name_of_API_client”, “clientname”: “name_of_API_client”, “validator”: true, “create_key”: true
}
DELETE: /organizations/NAME/clients/NAME This method has no request body. The response has no body.
GET: /organizations/NAME/clients/NAME This method has no request body. Response: {
“name”: “user1”, “clientname”: “user1”, “orgname”: “test”, “json_class”: “Chef::ApiClient”, “chef_type”: “client”, “validator”: “false”
}
PUT: /organizations/NAME/clients/NAME with a request body similar to: {
“name”: “monkeypants”, “validator”: false
} The response is similar to: {
“name”: “monkeypants”, “clientname”: “monkeypants”, “validator”: true, “json_class”:”Chef::ApiClient”, “chef_type”:”client”
}
cheflib.entities.cookbook module¶
Chef cookbook entity.
GET /organizations/NAME/cookbooks
- {
- “apache2”: {
“url”: “https://localhost/cookbooks/apache2”, “versions”: [
- {“url”: “https://localhost/cookbooks/apache2/5.1.0”,
“version”: “5.1.0”},
- {“url”: “https://localhost/cookbooks/apache2/4.2.0”,
“version”: “4.2.0”}
]
}, “nginx”: {
“url”: “https://localhost/cookbooks/nginx”, “versions”: [
- {“url”: “https://localhost/cookbooks/nginx/1.0.0”,
“version”: “1.0.0”},
- {“url”: “https://localhost/cookbooks/nginx/0.3.0”,
“version”: “0.3.0”}
]
}
}
cheflib.entities.databag module¶
Chef data bag entity.
GET: /organizations/NAME/data {
“users”: “https://chef.example/organizations/NAME/data/users”, “applications”: “https://chef.example/organizations/NAME/data/applications”
}
POST: /organizations/NAME/data {
“name”: “users”
}
GET: /organizations/NAME/data/NAME/ITEM {
“real_name”: “Adam Jacob”, “id”: “adam”
}
- class cheflib.entities.databag.DataBag(_chef: 'Chef', _name: str, _url: str, _data: Dict | None = None)[source]¶
Bases:
Entity- create_item(name, data, secret=None) DataBagItem | None[source]¶
- get_item_by_name(name: str, secret: bytes | None = None) [<class 'cheflib.entities.databagitem.DataBagItem'>, None][source]¶
- property get_item_names¶
cheflib.entities.databagitem module¶
Chef data bag entity.
GET: /organizations/NAME/data {
“users”: “https://chef.example/organizations/NAME/data/users”, “applications”: “https://chef.example/organizations/NAME/data/applications”
}
POST: /organizations/NAME/data {
“name”: “users”
}
GET: /organizations/NAME/data/NAME/ITEM {
“real_name”: “Adam Jacob”, “id”: “adam”
}
cheflib.entities.environment module¶
Chef environment entity.
cheflib.entities.node module¶
Chef node entity.
- {
“name”: “latte”, “chef_type”: “node”, “json_class”: “Chef::Node”, “attributes”: {
“hardware_type”: “laptop”
}, “overrides”: {}, “defaults”: {}, “run_list”: [ “recipe[unicorn]” ]
}
- {
‘automatic’: {}, ‘chef_environment’: ‘_default’, ‘chef_type’: ‘node’, ‘default’: {}, ‘json_class’: ‘Chef::Node’, ‘name’: ‘magweg’, ‘normal’: {}, ‘override’: {}, ‘run_list’: []
}
cheflib.entities.role module¶
Chef role entity.
Module contents¶
cheflib package.
Import all parts from cheflib.entities here