Cookbook Versions

Contents

Cookbook Versions

Cookbooks are the building blocks for installing and configuring the software using Chef-Zero. A cookbook can be regarded as a package of modular codified system administration, which encompasses a set of system administration recipes and attributes that allow fine-grained configuration. When preparing a template for a server (explained) below, specific versions of different cookbooks can be used, and these can be specified to be Opscode Chef Supermarket cookbooks maintained by the community or custom cookbooks prepared by users themselves. The API requests we describe below allow managing the set of custom cookbook versions available to the user in the platform.

List Cookbook Versions

GET /v3/blueprint/cookbook_versions

It lists all available cookbook versions.

Inputs

None

Returns

An array of cookbook versions with the following format:

Field Type Description
id String Identifier of the cookbook version.
name String Name of the cookbook.
version String The version of the cookbook, three natural numbers separated by dots.
description String Description of the cookbook version's purpose, specified in its metadata.
publicly_available Boolean Whether this cookbook version is available to all users, false for any cookbook version uploaded by a user
state String One of "created", "processing", "duplicated", "ready" or "processing_error",  the status of the cookbook version and its availability to be used in a template.
error_message String Optional, this field may describe the reason why a cookbook version transitioned to the "processing_error" state.
revision_id String A checksum identifying the contents of the cookbook version.
recipes Array of strings A list of recipes that the cookbook version encompasses.
global_legacy Boolean Optional, if present and set to true, it indicates the cookbook version used to be a  publicly available one but was deprecated as such in the platform and may no longer be compatible with the version of chef-client currently in use.
label_ids Array of strings List of ids corresponding to the labels the cookbook version has assigned.
resource_type String An identifier for the type of resource, specifically "cookbook_version".

Back to top

Show Cookbook Version

GET /v3/blueprint/cookbook_versions/:id

It shows information about a specific cookbook version.

Inputs

None

Returns

Field Type Description
id String Identifier of the cookbook version.
name String Name of the cookbook.
version String The version of the cookbook, three natural numbers separated by dots.
description String Description of the cookbook version's purpose, specified in its metadata.
license String The license of the software included in the cookbook version.
long_description String A longer description of the cookbook version's purpose, normally including documentation about its use, specified in its metadata.
attribute_metadata Object Optional, if the cookbook version defines it in its metadata, the attribute metadata: an object with attribute paths as keys and objects specifying the following attribute properties: "calculated", "choice","default", "description", "display_name", "required" and "type".
default_attributes Object If the cookbook version defines attribute metadata, an object with the default values this will take when used in a template.
publicly_available Boolean Whether this cookbook version is available to all users, false for any cookbook version uploaded by a user.
state String One of "created", "processing", "duplicated", "ready" or "processing_error",  the status of the cookbook version and its availability to be used in a template.
error_message String Optional, this field may describe the reason why a cookbook version transitioned to the "processing_error" state.
revision_id String A checksum identifying the contents of the cookbook version.
recipes Array of strings A list of recipes that the cookbook version encompasses.
global_legacy Boolean Optional, if present and set to true, it indicates the cookbook version used to be a  publicly available one but was deprecated as such in the platform and may no longer be compatible with the version of chef-client currently in use.
label_ids Array of strings List of ids corresponding to the labels the cookbook version has assigned.
duplicate_cookbook_version_id String Optional, it indicates the Id of the cookbook version already in the system that this cookbook version is duplicated of if any.
duplicate_cookbook_version_revision_id String Optional, present if there is a duplicate_cookbook_version_id, indicates the revision id of the cookbook version already in the system that this cookbook version is duplicated of.
download_url String Url where the cookbook can be downloaded.
resource_type String An identifier for the type of resource, specifically "cookbook_version".

Back to top

Create Cookbook Version

POST /v3/blueprint/cookbook_versions

It creates a new cookbook version record.

Inputs

Field Type Description Required
is_mock String Indicates whether this cookbook version is intended to be used for testing or not Yes

Returns

Field Type Description
id String Identifier of the cookbook version.
name String Name of the cookbook.
version String The version of the cookbook, three natural numbers separated by dots.
description String Description of the cookbook version's purpose, specified in its metadata.
publicly_available Boolean Whether this cookbook version is available to all users, false for any cookbook version uploaded by a user.
state String One of "created", "processing", "duplicated", "ready" or "processing_error",  the status of the cookbook version and its availability to be used in a template.
error_message String Optional, this field may describe the reason why a cookbook version transitioned to the "processing_error" state.
revision_id String A checksum identifying the contents of the cookbook version.
recipes Array of strings A list of recipes that the cookbook version encompasses.
global_legacy Boolean Optional, if present and set to true, it indicates the cookbook version used to be a  publicly available one but was deprecated as such in the platform and may no longer be compatible with the version of chef-client currently in use.
label_ids Array of strings List of ids corresponding to the labels the cookbook version has assigned.
resource_type String An identifier for the type of resource, specifically "cookbook_version".
upload_url String Url where the user must update the cookbook.

Back to top

Process Cookbook Version

POST /v3/blueprint/cookbook_versions/:id/process

It tells the system that the user has already uploaded the cookbook to the provided URL and it is ready to be processed.

Inputs

None

Returns

Field Type Description
id String Identifier of the cookbook version.
name String Name of the cookbook.
version String The version of the cookbook, three natural numbers separated by dots.
description String Description of the cookbook version's purpose, specified in its metadata.
license String The license of the software included in the cookbook version.
long_description String A longer description of the cookbook version's purpose, normally including documentation about its use, specified in its metadata.
attribute_metadata Object Optional, if the cookbook version defines it in its metadata, the attribute metadata: an object with attribute paths as keys and objects specifying the following attribute properties: "calculated", "choice","default", "description", "display_name", "required" and "type".
default_attributes Object If the cookbook version defines attribute metadata, an object with the default values this will take when used in a template.
publicly_available Boolean Whether this cookbook version is available to all users, false for any cookbook version uploaded by a user.
state String One of "created", "processing", "duplicated", "ready" or "processing_error",  the status of the cookbook version and its availability to be used in a template.
error_message String Optional, this field may describe the reason why a cookbook version transitioned to the "processing_error" state.
revision_id String A checksum identifying the contents of the cookbook version.
recipes Array of strings A list of recipes that the cookbook version encompasses.
global_legacy Boolean Optional, if present and set to true, it indicates the cookbook version used to be a  publicly available one but was deprecated as such in the platform and may no longer be compatible with the version of chef-client currently in use.
label_ids Array of strings List of ids corresponding to the labels the cookbook version has assigned.
duplicate_cookbook_version_id String Optional, it indicates the Id of the cookbook version already in the system that this cookbook version is duplicated of if any.
duplicate_cookbook_version_revision_id String Optional, present if there is a duplicate_cookbook_version_id, indicates the revision id of the cookbook version already in the system that this cookbook version is duplicated of.
download_url String Url where the cookbook can be downloaded.
resource_type String An identifier for the type of resource, specifically "cookbook_version".

Back to top

Destroy Cookbook Version

DELETE /v3/blueprint/cookbook_versions/:id

It deletes a cookbook version.

Inputs

None

Returns

None

Back to top