From 7cab0830eaf3fc3a80853f79be51cfc8bdbf7f12 Mon Sep 17 00:00:00 2001 From: Ryan Bak Date: Mon, 28 Aug 2023 11:10:07 -0400 Subject: [PATCH] CASMCMS-8723: Update CFS cli for v3/paging changes --- cray/modules/cfs/cli.py | 45 +- cray/modules/cfs/swagger3.json | 27622 ++++++++++++++++++-------- cray/tests/test_modules/test_cfs.py | 154 +- 3 files changed, 19574 insertions(+), 8247 deletions(-) diff --git a/cray/modules/cfs/cli.py b/cray/modules/cfs/cli.py index 7a35a40..7b010f4 100644 --- a/cray/modules/cfs/cli.py +++ b/cray/modules/cfs/cli.py @@ -44,6 +44,7 @@ from cray.generator import generate CURRENT_VERSION = 'v2' +PRESERVE_VERSIONS = True SWAGGER_OPTS = { 'vocabulary': { 'deleteall': 'deleteall' @@ -51,14 +52,23 @@ } cli = generate(__file__, condense=False, swagger_opts=SWAGGER_OPTS) -cli.commands = cli.commands[CURRENT_VERSION].commands + +if PRESERVE_VERSIONS: + cli.commands.update(cli.commands[CURRENT_VERSION].commands) +else: + cli.commands = cli.commands[CURRENT_VERSION].commands def setup(cfs_cli): """ Sets up all cfs overrides """ - setup_configurations_update(cfs_cli) - setup_sessions_create(cfs_cli) - setup_components_update(cfs_cli) + setup_configurations_update(cfs_cli, "v2") + setup_sessions_create(cfs_cli, "v2") + remove_sessions_update(cfs_cli, "v2") + setup_components_update(cfs_cli, "v2") + setup_configurations_update(cfs_cli, "v3") + setup_sessions_create(cfs_cli, "v3") + remove_sessions_update(cfs_cli, "v3") + setup_components_update(cfs_cli, "v3") # CONFIGURATIONS # @@ -85,7 +95,7 @@ def _decorator(configuration_id, file, update_branches, **kwargs): return _decorator -def setup_configurations_update(cfs_cli): +def setup_configurations_update(cfs_cli, version): """ Adds the --file and --update-branches parameters for configuration updates """ tmp_swagger_opts = { 'vocabulary': { @@ -93,10 +103,9 @@ def setup_configurations_update(cfs_cli): } } tmp_cli = generate(__file__, condense=False, swagger_opts=tmp_swagger_opts) - tmp_cli.commands = tmp_cli.commands[CURRENT_VERSION].commands - update_command = tmp_cli.commands['configurations'].commands['update'] - patch_command = tmp_cli.commands['configurations'].commands['patch'] + update_command = tmp_cli.commands[version].commands['configurations'].commands['update'] + patch_command = tmp_cli.commands[version].commands['configurations'].commands['patch'] option( '--file', callback=_opt_callback, type=str, metavar='TEXT', @@ -117,14 +126,18 @@ def setup_configurations_update(cfs_cli): patch_command.callback ) - cfs_cli.commands['configurations'].commands['update'] = update_command + cfs_cli.commands[version].commands['configurations'].commands['update'] = update_command # SESSIONS # -# Update session should only be in the api as it is not user friendly and -# is only used by CFS to update session status. -del cli.commands['sessions'].commands['update'] +def remove_sessions_update(cfs_cli, version): + """ + Update session should only be in the api as it is not user friendly and + is only used by CFS to update session status. + """ + del cfs_cli.commands[version].commands['sessions'].commands['update'] + def _target_groups_callback(cb): @@ -201,9 +214,9 @@ def _decorator( IMAGE_MAP_PAYLOAD = 'target-image-map' -def setup_sessions_create(cfs_cli): +def setup_sessions_create(cfs_cli, version): """ Adds the --tags and --target-group parameters for session creates """ - command = cfs_cli.commands['sessions'].commands['create'] + command = cfs_cli.commands[version].commands['sessions'].commands['create'] # Create a new option which can handle multiple groups with individual names # and member lists. `option` acts as a decorator here. @@ -274,9 +287,9 @@ def _decorator(component_id, state, tags, **kwargs): return _decorator -def setup_components_update(cfs_cli): +def setup_components_update(cfs_cli, version): """ Adds the --state and --tags parameters for component updates """ - command = cfs_cli.commands['components'].commands['update'] + command = cfs_cli.commands[version].commands['components'].commands['update'] option( '--state', callback=_opt_callback, diff --git a/cray/modules/cfs/swagger3.json b/cray/modules/cfs/swagger3.json index 85fe818..0edd17d 100644 --- a/cray/modules/cfs/swagger3.json +++ b/cray/modules/cfs/swagger3.json @@ -1,8805 +1,19989 @@ { - "openapi": "3.0.2", - "info": { - "title": "Configuration Framework Service", - "version": "0000.0000.0000", - "description": "The Configuration Framework Service (CFS) manages the launch of Ansible Execution Environments for image customization, node personalization, and node reconfiguration. CFS manages the Ansible staging container that pulls Ansible play/role content and inventory (optional) from the git server and launches the Ansible Execution Environment.\n\nCFS includes the following components:\n\n * CFS REST API\n * A Kubernetes operator running on the management services infrastructure to handle\n the lifecycle and reporting of configuration sessions.\n * Pre-packaged Ansible Execution Environment(s) (AEE) with values tuned for performant\n configuration for executing Ansible playbooks against Cray compute and user access nodes.\n\n\nCFS uses a Git version control server running in the management services infrastructure for management of the configuration manifest lifecycle.\n\n\n The CFS API allows an administrator to customize the compute and user access nodes\n in the following ways:\n* Customize the bootable images prior to their use on the system. This process is called\n image customization. CFS uses IMS to stage images in an ssh container and then modifies\n one or more images using Ansible.\n\n* Customize live nodes during boot or post-boot. This process is called node personalization.\n Node personalization involves applying software and/or configuration that differentiates\n a node or a group of nodes from all other groups of nodes.\n This should be used in scenarios where configuration cannot be applied prior to booting\n a node. It is typically best to make changes pre-boot via image customization. This ensures\n Ansible only has to run once against an image, rather than against every individual booted node.\n The BOS and IMS APIs support CFS to customize live nodes during boot time.\n\n## Resources\n/healthz - Check service health\n\n/options - Updates service options.\n\n/sessions - Create, retrieve, or delete configuration sessions.\n\n/components - Add, update, retrieve, or delete component information.\n\n/configurations - Add, update, retrieve or delete desired configuration states. (v2 api only)\n## Workflows\n### Image Customization\n\n #### GET /images\n\n Identify the IMS image that you want to customize. Note the id of the image that you want to customize.\n\n #### POST /sessions\n\n Create a configuration session and push the configuration to the specific image in IMS.\n You must specify the target definition as image and provide id of the image that you want to customize.\n This step customizes the image as per Ansible playbook and saves the image in the IMS.\n\n\n### Node Personalization\n\n #### POST /sessions\n Create a configuration framework session to push configuration to nodes that have already\n been booted, specifying the target (optional), the git repository location, inventory (optional),\n and gives the session a unique name.\n\n #### GET /sessions/{session_name}\n View details and status for the specific session_name.\n\n #### DELETE /sessions/{session_name}\n Delete all session history for session_name (as needed).\n\nThe default content type for the CFS API is `application/json`. Unsuccessful API calls return a content type of `application/problem+json` as per RFC 7807.\n" - }, - "servers": [ - { - "url": "https://api-gw-service-nmn.local/apis/cfs", - "description": "The production CFS API server" - } - ], - "components": { - "requestBodies": { - "V2SessionCreateRequest": { - "description": "A JSON object for creating Config Framework Sessions", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "The information required to create a Config Framework Session.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configurationName": { - "type": "string", - "description": "The name of a CFS configuration to apply", - "example": "example-config" - }, - "configurationLimit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3", - "default": "" - }, - "ansibleLimit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1", - "pattern": "^[^\\s;]*$" - }, - "ansibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "ansibleVerbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "ansiblePassthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" + "openapi": "3.0.2", + "info": { + "title": "Configuration Framework Service", + "version": "0000.0000.0000", + "description": "The Configuration Framework Service (CFS) manages the launch of Ansible Execution Environments for image customization, node personalization, and node reconfiguration. CFS manages the Ansible staging container that pulls Ansible play/role content and inventory (optional) from the git server and launches the Ansible Execution Environment.\n\nCFS includes the following components:\n\n * CFS REST API\n * A Kubernetes operator running on the management services infrastructure to handle\n the lifecycle and reporting of configuration sessions.\n * Pre-packaged Ansible Execution Environment(s) (AEE) with values tuned for performant\n configuration for executing Ansible playbooks against Cray compute and user access nodes.\n\n\nCFS uses a Git version control server running in the management services infrastructure for management of the configuration manifest lifecycle.\n\n\n The CFS API allows an administrator to customize the compute and user access nodes\n in the following ways:\n* Customize the bootable images prior to their use on the system. This process is called\n image customization. CFS uses IMS to stage images in an ssh container and then modifies\n one or more images using Ansible.\n\n* Customize live nodes during boot or post-boot. This process is called node personalization.\n Node personalization involves applying software and/or configuration that differentiates\n a node or a group of nodes from all other groups of nodes.\n This should be used in scenarios where configuration cannot be applied prior to booting\n a node. It is typically best to make changes pre-boot via image customization. This ensures\n Ansible only has to run once against an image, rather than against every individual booted node.\n The BOS and IMS APIs support CFS to customize live nodes during boot time.\n\n## Resources\n/healthz - Check service health\n\n/options - Updates service options.\n\n/sessions - Create, retrieve, or delete configuration sessions.\n\n/components - Add, update, retrieve, or delete component information.\n\n/configurations - Add, update, retrieve or delete desired configuration states. (v2 api only)\n## Workflows\n### Image Customization\n\n #### GET /images\n\n Identify the IMS image that you want to customize. Note the id of the image that you want to customize.\n\n #### POST /sessions\n\n Create a configuration session and push the configuration to the specific image in IMS.\n You must specify the target definition as image and provide id of the image that you want to customize.\n This step customizes the image as per Ansible playbook and saves the image in the IMS.\n\n\n### Node Personalization\n\n #### POST /sessions\n Create a configuration framework session to push configuration to nodes that have already\n been booted, specifying the target (optional), the git repository location, inventory (optional),\n and gives the session a unique name.\n\n #### GET /sessions/{session_name}\n View details and status for the specific session_name.\n\n #### DELETE /sessions/{session_name}\n Delete all session history for session_name (as needed).\n\nThe default content type for the CFS API is `application/json`. Unsuccessful API calls return a content type of `application/problem+json` as per RFC 7807.\n" + }, + "servers": [ + { + "url": "https://api-gw-service-nmn.local/apis/cfs", + "description": "The production CFS API server" + } + ], + "components": { + "requestBodies": { + "V2SessionCreateRequest": { + "description": "A JSON object for creating Config Framework Sessions", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The information required to create a Config Framework Session.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configurationName": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config" + }, + "configurationLimit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansibleLimit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansibleVerbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansiblePassthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "name", + "configurationName" ], - "items": { - "type": "string" - } - } + "additionalProperties": false } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } + } + } + }, + "V3SessionCreateRequest": { + "description": "A JSON object for creating Config Framework Sessions", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The information required to create a Config Framework Session.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration_name": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config", + "minLength": 1, + "maxLength": 60 + }, + "configuration_limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansible_limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansible_verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansible_passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + } + }, + "required": [ + "name", + "configuration_name" + ], + "additionalProperties": false } - } } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } } - }, - "required": [ - "name", - "configurationName" - ], - "additionalProperties": false - } - } - } - }, - "V2OptionsUpdateRequest": { - "description": "Service-wide configuration options", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "Configuration options for the configuration service.\n", - "type": "object", - "properties": { - "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 - }, - "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 - }, - "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 - }, - "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 - }, - "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 - }, - "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" - }, - "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" - }, - "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 - }, - "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." - }, - "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." - }, - "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + }, + "V2OptionsUpdateRequest": { + "description": "Service-wide configuration options", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardwareSyncInterval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 + }, + "batcherCheckInterval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 + }, + "batchSize": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 + }, + "batchWindow": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 + }, + "defaultBatcherRetryPolicy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 + }, + "defaultPlaybook": { + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "defaultAnsibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" + }, + "sessionTTL": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" + }, + "additionalInventoryUrl": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "batcherMaxBackoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 + }, + "batcherDisable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcherPendingTimeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + }, + "loggingLevel": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + } + } } - }, - "additionalProperties": false - } - } - } - }, - "V2ComponentsUpdateRequest": { - "description": "The configuration/state for an array of components", - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "patch": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", + }, + "V3OptionsUpdateRequest": { + "description": "Service-wide configuration options", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", "type": "object", "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } }, "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + } + } + } + }, + "V2ComponentsUpdateRequest": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "configName": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "V3ComponentsUpdateRequest": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured", + "" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "config_name": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "V2ComponentUpdateRequest": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "additionalProperties": false + } + } + } + }, + "V3ComponentUpdateRequest": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "additionalProperties": false + } + } + } + }, + "V2ConfigurationUpdateRequest": { + "description": "A desired configuration state", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "additionalProperties": false + } + } + } + }, + "V3ConfigurationUpdateRequest": { + "description": "A desired configuration state", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", + "additionalProperties": false + } + } + } + } + }, + "responses": { + "Version": { + "description": "Version information for the service", + "content": { + "application/json": { + "schema": { + "description": "Version data", "type": "object", "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "integer" + } }, "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "filters": { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "ids": { - "type": "string", - "description": "A comma-separated list of component IDs" - }, - "status": { - "type": "string", - "description": "All components with this status will be patched.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ] - }, - "enabled": { - "type": "boolean", - "description": "Patches all components with the given \"enabled\" state." - }, - "configName": { - "type": "string", - "description": "A configuration name. All components with this configuration set will be patched." - }, - "tags": { - "type": "string", - "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." - } - } - } - }, - "required": [ - "patch", - "filters" - ] - }, - { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - ] - } - } - } - }, - "V2ComponentUpdateRequest": { - "description": "The configuration/state for a single component", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - } - }, - "ConfigurationUpdateRequest": { - "description": "A desired configuration state", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - } - }, - "responses": { - "Version": { - "description": "Version information for the service", - "content": { - "application/json": { - "schema": { - "description": "Version data", - "type": "object", - "properties": { - "major": { - "type": "integer" - }, - "minor": { - "type": "integer" - }, - "patch": { - "type": "integer" - } - }, - "additionalProperties": false - } - } - } - }, - "Healthz": { - "description": "Status information for the service", - "content": { - "application/json": { - "schema": { - "description": "Service health status", - "type": "object", - "properties": { - "dbStatus": { - "type": "string" - }, - "kafkaStatus": { - "type": "string" - } - }, - "additionalProperties": false - } - } - } - }, - "V2Options": { - "description": "A collection of service-wide configuration options", - "content": { - "application/json": { - "schema": { - "description": "Configuration options for the configuration service.\n", - "type": "object", - "properties": { - "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 - }, - "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 - }, - "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 - }, - "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 - }, - "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 - }, - "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" - }, - "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" - }, - "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 - }, - "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." - }, - "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." - }, - "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." - } - }, - "additionalProperties": false - } - } - } - }, - "V2SessionDetails": { - "description": "A single configuration session", - "content": { - "application/json": { - "schema": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } - } - }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" - }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } - } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } - } - } - }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } - } - } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" - }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" - } - } - } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - } - }, - "V2SessionDetailsArray": { - "description": "A collection of configuration sessions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } - } - }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" - }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } - } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } - } - } - }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } - } - } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" - }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" - } } - } } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - } - } - }, - "V2ComponentDetails": { - "description": "A single component state", - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } } - }, - "additionalProperties": false - } - } - } - }, - "V2ComponentDetailsArray": { - "description": "A collection of component states", - "content": { - "application/json": { - "schema": { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + }, + "Healthz": { + "description": "Status information for the service", + "content": { + "application/json": { + "schema": { + "description": "Service health status", + "type": "object", + "properties": { + "db_status": { + "type": "string" + }, + "kafka_status": { + "type": "string" + } + }, + "additionalProperties": false } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - } - } - }, - "ConfigurationDetails": { - "description": "A single configuration", - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - }, - "ConfigurationDetailsArray": { - "description": "A collection of configurations", - "content": { - "application/json": { - "schema": { - "description": "An array of configurations.", - "type": "array", - "items": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - } - }, - "ResourceDeleted": { - "description": "The resource was deleted." - }, - "BadRequest": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - }, - "ResourceNotFound": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - }, - "ConflictingSessionName": { - "description": "A session with the same name already exists.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - } - }, - "schemas": { - "Link": { - "description": "Link to other resources", - "type": "object", - "properties": { - "rel": { - "type": "string", - "example": "/sessions/session-20190728032600" - }, - "href": { - "type": "string" - } - }, - "additionalProperties": false - }, - "Version": { - "description": "Version data", - "type": "object", - "properties": { - "major": { - "type": "integer" - }, - "minor": { - "type": "integer" - }, - "patch": { - "type": "integer" - } - }, - "additionalProperties": false - }, - "Healthz": { - "description": "Service health status", - "type": "object", - "properties": { - "dbStatus": { - "type": "string" - }, - "kafkaStatus": { - "type": "string" - } - }, - "additionalProperties": false - }, - "V2Options": { - "description": "Configuration options for the configuration service.\n", - "type": "object", - "properties": { - "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 - }, - "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 - }, - "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 - }, - "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 - }, - "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 - }, - "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" - }, - "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" - }, - "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 - }, - "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." - }, - "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." - }, - "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." - } - }, - "additionalProperties": false - }, - "TargetSpecSection": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } - } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } - } - } - }, - "V2Session": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } - } - }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" - }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } - } - } - }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } - } - } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" - }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" - } } - } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "V2SessionCreate": { - "description": "The information required to create a Config Framework Session.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configurationName": { - "type": "string", - "description": "The name of a CFS configuration to apply", - "example": "example-config" - }, - "configurationLimit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3", - "default": "" - }, - "ansibleLimit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1", - "pattern": "^[^\\s;]*$" - }, - "ansibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "ansibleVerbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "ansiblePassthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } + }, + "V2Options": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardwareSyncInterval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 + }, + "batcherCheckInterval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 + }, + "batchSize": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 + }, + "batchWindow": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 + }, + "defaultBatcherRetryPolicy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 + }, + "defaultPlaybook": { + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "defaultAnsibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" + }, + "sessionTTL": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" + }, + "additionalInventoryUrl": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "batcherMaxBackoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 + }, + "batcherDisable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcherPendingTimeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + }, + "loggingLevel": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + } } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } - } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "name", - "configurationName" - ], - "additionalProperties": false - }, - "AdditionalInventoryLayer": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - }, - "ConfigurationLayer": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - }, - "Configuration": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "ConfigurationArray": { - "description": "An array of configurations.", - "type": "array", - "items": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." + "V3Options": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } + }, + "additionalProperties": false + } + } + } }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "V2SessionDetails": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } + "V3SessionData": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" + "V2SessionDetailsArray": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "An array of sessions.", + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - }, - "ConfigurationStateLayer": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "V2ComponentState": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + }, + "V3SessionDataCollection": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "V3SessionIdCollection": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } + } + } + } }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "V2ComponentDetails": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "V2ComponentStateArray": { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" + "V3ComponentData": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" + "V2ComponentDetailsArray": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + } }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "V3ComponentDataCollection": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "A collection of component data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } } - }, - "additionalProperties": false }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" + "V3ComponentIdCollection": { + "description": "A collection of component ids", + "content": { + "application/json": { + "schema": { + "description": "A collection of component ids.", + "type": "object", + "properties": { + "component_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true + "V2ConfigurationDetails": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." + "V3ConfigurationData": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." + "V2ConfigurationDetailsArray": { + "description": "A collection of configurations", + "content": { + "application/json": { + "schema": { + "description": "An array of configurations.", + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + } }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." + "V3ConfigurationDataCollection": { + "description": "A collection of configurations", + "content": { + "application/json": { + "schema": { + "description": "A collection of configuration data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } + } }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true + "ResourceDeleted": { + "description": "The resource was deleted." }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - }, - "V2ComponentsFilter": { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "ids": { - "type": "string", - "description": "A comma-separated list of component IDs" - }, - "status": { - "type": "string", - "description": "All components with this status will be patched.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ] - }, - "enabled": { - "type": "boolean", - "description": "Patches all components with the given \"enabled\" state." - }, - "configName": { - "type": "string", - "description": "A configuration name. All components with this configuration set will be patched." - }, - "tags": { - "type": "string", - "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." - } - } - }, - "V2ComponentsUpdate": { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "patch": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "BadRequest": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + } + }, + "ResourceNotFound": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" } - } }, - "additionalProperties": false - }, - "filters": { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "ids": { - "type": "string", - "description": "A comma-separated list of component IDs" - }, - "status": { - "type": "string", - "description": "All components with this status will be patched.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ] - }, - "enabled": { - "type": "boolean", - "description": "Patches all components with the given \"enabled\" state." - }, - "configName": { - "type": "string", - "description": "A configuration name. All components with this configuration set will be patched." - }, - "tags": { - "type": "string", - "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." - } - } - } - }, - "required": [ - "patch", - "filters" - ] - }, - "ProblemDetails": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - }, - "paths": { - "/": { - "get": { - "summary": "Get API versions", - "description": "Return list of versions currently running.", - "tags": [ - "version" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.versions", - "operationId": "get_version", - "responses": { - "200": { - "description": "Version information for the service", - "content": { - "application/json": { - "schema": { - "description": "Version data", - "type": "object", - "properties": { - "major": { - "type": "integer" - }, - "minor": { - "type": "integer" - }, - "patch": { - "type": "integer" + "ConflictingSessionName": { + "description": "A session with the same name already exists.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } } - }, - "additionalProperties": false } - } } - } - } - } - }, - "/versions": { - "get": { - "summary": "Get API versions", - "description": "Return list of versions currently running.", - "tags": [ - "version" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.versions", - "operationId": "get_versions", - "responses": { - "200": { - "description": "Version information for the service", - "content": { - "application/json": { - "schema": { - "description": "Version data", - "type": "object", - "properties": { + }, + "schemas": { + "Version": { + "description": "Version data", + "type": "object", + "properties": { "major": { - "type": "integer" + "type": "integer" }, "minor": { - "type": "integer" + "type": "integer" }, "patch": { - "type": "integer" + "type": "integer" } - }, - "additionalProperties": false - } - } - } - } - } - } - }, - "/healthz": { - "get": { - "summary": "Get service health details", - "tags": [ - "healthz" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.healthz", - "operationId": "get_healthz", - "description": "Get cfs-api health details.", - "responses": { - "200": { - "description": "Status information for the service", - "content": { - "application/json": { - "schema": { - "description": "Service health status", - "type": "object", - "properties": { - "dbStatus": { - "type": "string" - }, - "kafkaStatus": { - "type": "string" - } - }, - "additionalProperties": false - } - } - } - }, - "503": { - "description": "Status information for the service", - "content": { - "application/json": { - "schema": { - "description": "Service health status", - "type": "object", - "properties": { - "dbStatus": { - "type": "string" - }, - "kafkaStatus": { - "type": "string" - } - }, - "additionalProperties": false - } - } - } - } - } - } - }, - "/v2": { - "get": { - "summary": "Get API versions", - "description": "Return list of versions currently running.", - "tags": [ - "version" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.versions", - "operationId": "get_versions_v2", - "responses": { - "200": { - "description": "Version information for the service", - "content": { - "application/json": { - "schema": { - "description": "Version data", - "type": "object", - "properties": { - "major": { - "type": "integer" + }, + "additionalProperties": false + }, + "Healthz": { + "description": "Service health status", + "type": "object", + "properties": { + "db_status": { + "type": "string" }, - "minor": { - "type": "integer" + "kafka_status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "V3NextData": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" }, - "patch": { - "type": "integer" + "after_id": { + "type": "string" } - }, - "additionalProperties": false - } - } - } - } - } - } - }, - "/v2/options": { - "get": { - "summary": "Retrieve the configuration service options", - "tags": [ - "options", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.options", - "description": "Retrieve the list of configuration service options.", - "operationId": "get_options", - "responses": { - "200": { - "description": "A collection of service-wide configuration options", - "content": { - "application/json": { - "schema": { - "description": "Configuration options for the configuration service.\n", - "type": "object", - "properties": { + }, + "additionalProperties": true + }, + "V2Options": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 }, "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 }, "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 }, "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 }, "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 }, "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" }, "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" }, "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" }, "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" }, "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 }, "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." }, "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." }, "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + }, + "V3Options": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } + }, + "additionalProperties": false + }, + "SessionTargetSection": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "SessionConfigurationSection": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "SessionAnsibleSection": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "SessionStatusArtifactsSection": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } } - }, - "additionalProperties": false } - } - } - } - } - }, - "patch": { - "summary": "Update configuration service options", - "tags": [ - "options", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.options", - "operationId": "patch_options", - "description": "Update one or more of the configuration service options.", - "requestBody": { - "description": "Service-wide configuration options", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "Configuration options for the configuration service.\n", + }, + "V2SessionStatusSessionSection": { "type": "object", + "description": "Status of session", "properties": { - "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 - }, - "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 - }, - "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 - }, - "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 - }, - "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 - }, - "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" - }, - "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" - }, - "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 - }, - "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." - }, - "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." - }, - "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." - } - }, - "additionalProperties": false - } - } - } - }, - "responses": { - "200": { - "description": "A collection of service-wide configuration options", - "content": { - "application/json": { - "schema": { - "description": "Configuration options for the configuration service.\n", - "type": "object", - "properties": { - "hardwareSyncInterval": { - "type": "integer", - "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", - "example": 5 - }, - "batcherCheckInterval": { - "type": "integer", - "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", - "example": 5 - }, - "batchSize": { - "type": "integer", - "description": "The maximum number of nodes the batcher will run a single CFS session against.", - "example": 120 + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" }, - "batchWindow": { - "type": "integer", - "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", - "example": 120 + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" }, - "defaultBatcherRetryPolicy": { - "type": "integer", - "description": "The default maximum number retries per node when configuration fails.", - "example": 1 + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" }, - "defaultPlaybook": { - "type": "string", - "description": "The default playbook to be used if not specified in a node's desired state.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" }, - "defaultAnsibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", - "example": "cfs-default-ansible-cfg" + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + }, + "V3SessionStatusSessionSection": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" }, - "sessionTTL": { - "type": "string", - "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", - "example": "24h" + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" }, - "additionalInventoryUrl": { - "type": "string", - "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", - "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", - "pattern": "^[^\\s;]*$" + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" }, - "batcherMaxBackoff": { - "type": "integer", - "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", - "example": 3600 + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" }, - "batcherDisable": { - "type": "boolean", - "description": "Disables cfs-batcher's automatic session creation if set to True." + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + }, + "V2SessionStatusSection": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } }, - "batcherPendingTimeout": { - "type": "integer", - "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "V3SessionStatusSection": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } }, - "loggingLevel": { - "type": "string", - "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } } - }, - "additionalProperties": false } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "V2Session": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } }, "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } } - } - } - } - } - } - } - } - }, - "/v2/sessions": { - "get": { - "summary": "Retrieve configuration framework sessions", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "description": "Retrieve all the configuration framework sessions on the system.", - "operationId": "get_sessions", - "parameters": [ - { - "name": "age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\" DEPRECATED: This field has been replaced by min_age and max_age" - }, - { - "name": "min_age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" - }, - { - "name": "max_age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" - }, - { - "name": "status", - "schema": { - "type": "string", - "enum": [ - "pending", - "running", - "complete" - ] - }, - "in": "query", - "description": "Return only sessions with the given status." - }, - { - "name": "name_contains", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions whose session name contains the given string." - }, - { - "name": "succeeded", - "schema": { - "type": "string", - "enum": [ - "none", - "true", - "false", - "unknown" - ] - }, - "in": "query", - "description": "Return only sessions that have succeeded/failed." - }, - { - "name": "tags", - "schema": { - "type": "string" + }, + "additionalProperties": false }, - "in": "query", - "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be returned." - } - ], - "responses": { - "200": { - "description": "A collection of configuration sessions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { + "V3SessionData": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { "type": "string", "description": "Name of the session. The length of the name is restricted to 45 characters.", "example": "session-20190728032600", "minLength": 1, "maxLength": 45, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configuration": { + }, + "configuration": { "type": "object", "description": "The configuration information which the session will apply", "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } } - }, - "ansible": { + }, + "ansible": { "type": "object", "description": "Additional options that will be used when invoking Ansible.", "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" - }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } } - }, - "target": { + }, + "target": { "type": "object", "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } } - } } - } } - }, - "status": { + }, + "status": { "type": "object", "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } } - } } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" - }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + }, + "V2SessionCreate": { + "description": "The information required to create a Config Framework Session.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configurationName": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config" + }, + "configurationLimit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansibleLimit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansibleVerbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansiblePassthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", "enum": [ - "none", - "true", - "false", - "unknown" + "image", + "spec", + "repo", + "dynamic" ], - "readOnly": true, - "type": "string" - } + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } } - } } - }, - "tags": { + }, + "tags": { "type": "object", "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", "additionalProperties": { - "type": "string" + "type": "string" } - } - }, - "additionalProperties": false - } - } - } - } - } - } - }, - "post": { - "summary": "Create a configuration framework session", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "operationId": "create_session", - "description": "Create a new configuration session. A configuration session stages Ansible inventory, launches one or more Ansible Execution Environments (AEE) as containers in the management services infrastructure, and tears down the environments as required. When a session is targeted for image customization, the inventory staging involves using IMS to expose the requested image roots, tearing down the image roots, and generating new boot artifacts afterwards. The session will checkout the prescribed branch or commit of the configuration repository and populate the configuration manifest to the AEE. The Ansible execution begins with an inventory prescribed by the user through CFS. A configuration session also tracks the status of the different stages of the operation and reports information on the success of its execution.", - "requestBody": { - "description": "A JSON object for creating Config Framework Sessions", - "required": true, - "content": { - "application/json": { - "schema": { + } + }, + "required": [ + "name", + "configurationName" + ], + "additionalProperties": false + }, + "V3SessionCreate": { "description": "The information required to create a Config Framework Session.\n", "type": "object", "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configurationName": { - "type": "string", - "description": "The name of a CFS configuration to apply", - "example": "example-config" - }, - "configurationLimit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3", - "default": "" - }, - "ansibleLimit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1", - "pattern": "^[^\\s;]*$" - }, - "ansibleConfig": { - "type": "string", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "ansibleVerbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "ansiblePassthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { + "name": { "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration_name": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config", + "minLength": 1, + "maxLength": 60 + }, + "configuration_limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansible_limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansible_verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansible_passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" - } - } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", - "required": [ - "source_id", - "result_name" - ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } } - } } - } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false } - } }, "required": [ - "name", - "configurationName" + "name", + "configuration_name" ], "additionalProperties": false - } - } - } - }, - "responses": { - "201": { - "description": "A single configuration session", - "content": { - "application/json": { - "schema": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" - }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { + }, + "V2SessionArray": { + "description": "An array of sessions.", + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } - } - }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { + "target": { "type": "object", - "required": [ - "name", - "members" - ], + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } } - } } - } }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { + "status": { "type": "object", - "required": [ - "source_id", - "result_name" - ], + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { "type": "string" - } } - } } - } }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { + "additionalProperties": false + } + }, + "V3SessionDataCollection": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", "type": "object", "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } } - } }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" + "additionalProperties": true + } + } + }, + "V3SessionIdCollection": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" - } - } + "additionalProperties": false } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } } - }, - "additionalProperties": false } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "V2AdditionalInventoryLayer": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + }, + "V3AdditionalInventoryLayer": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" } - } - } - } - } - }, - "409": { - "description": "A session with the same name already exists.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + }, + "V2ConfigurationLayer": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete multiple configuration framework sessions", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "operationId": "delete_sessions", - "parameters": [ - { - "name": "age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Deletes only sessions older than the given age. Age is given in the format \"1d\" or \"6h\" DEPRECATED: This field has been replaced by min_age and max_age" - }, - { - "name": "min_age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" - }, - { - "name": "max_age", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" - }, - { - "name": "status", - "schema": { - "type": "string", - "enum": [ - "pending", - "running", - "complete" - ], - "default": "complete" - }, - "in": "query", - "description": "Deletes only sessions with the given status." - }, - { - "name": "name_contains", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Delete only sessions whose session name contains the given string." - }, - { - "name": "succeeded", - "schema": { - "type": "string", - "enum": [ - "none", - "true", - "false", - "unknown" - ] - }, - "in": "query", - "description": "Delete only sessions that have succeeded/failed." - }, - { - "name": "tags", - "schema": { - "type": "string" + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false }, - "in": "query", - "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be deleted." - } - ], - "description": "Delete multiple configuration sessions. If filters are provided, only sessions matching all filters will be deleted. By default only completed sessions will be deleted.", - "responses": { - "204": { - "description": "The resource was deleted." - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + "V3ConfigurationLayer": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" } - } - } - } - } - } - } - } - }, - "/v2/sessions/{session_name}": { - "get": { - "summary": "Retrieve a configuration framework session by session_name", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "operationId": "get_session", - "description": "View details about a specific configuration session. This allows you to track the status of the session and the Ansible execution through the session.", - "responses": { - "200": { - "description": "A single configuration session", - "content": { - "application/json": { - "schema": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + }, + "V2Configuration": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" - } - } + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" - }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" - }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." - }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" - }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", "type": "object", - "required": [ - "name", - "members" - ], "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" - ], - "items": { - "type": "string" + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false } - } - } - } - }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { - "type": "object", + }, "required": [ - "source_id", - "result_name" + "cloneUrl" ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } + "additionalProperties": false } - } }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } - } - } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" + "description": "The name of the inventory layer.", + "example": "sample-inventory" }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" } - } - } - } - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false } - }, - "additionalProperties": false - } - } - } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + }, + "additionalProperties": false + }, + "V3ConfigurationData": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - } - } - }, - "patch": { - "summary": "Update a configuration framework session", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "operationId": "patch_session", - "description": "Update the status of an existing configuration framework session", - "responses": { - "200": { - "description": "A single configuration session", - "content": { - "application/json": { - "schema": { - "description": "An execution session for the Configuration Framework.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the session. The length of the name is restricted to 45 characters.", - "example": "session-20190728032600", - "minLength": 1, - "maxLength": 45, - "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, - "configuration": { - "type": "object", - "description": "The configuration information which the session will apply", - "properties": { - "name": { - "type": "string", - "description": "The name of the CFS configuration to be applied", - "example": "example-config" - }, - "limit": { - "type": "string", - "description": "A comma seperated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", - "example": "layer1,layer3" + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false } - } }, - "ansible": { - "type": "object", - "description": "Additional options that will be used when invoking Ansible.", - "properties": { - "config": { - "type": "string", - "default": "cfs-default-ansible-cfg", - "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", - "example": "cfs-default-ansible-cfg" + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } }, - "limit": { - "type": "string", - "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", - "example": "host1" + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "V2ConfigurationArray": { + "description": "An array of configurations.", + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true }, - "verbosity": { - "type": "integer", - "default": 0, - "minimum": 0, - "maximum": 4, - "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." }, - "passthrough": { - "type": "string", - "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." - } - } - }, - "target": { - "type": "object", - "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", - "properties": { - "definition": { - "type": "string", - "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", - "enum": [ - "image", - "spec", - "repo", - "dynamic" - ], - "default": "dynamic", - "example": "spec" + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, - "groups": { - "type": "array", - "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", - "items": { - "type": "object", - "required": [ - "name", - "members" - ], - "properties": { - "name": { - "description": "Group name", - "example": "test-computes", - "type": "string" - }, - "members": { - "description": "Group members for the inventory.\n", - "type": "array", - "example": [ - "nid000001", - "nid000002", - "nid000003" + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" ], - "items": { - "type": "string" - } - } + "additionalProperties": false } - } }, - "image_map": { - "type": "array", - "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", - "items": { + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, "required": [ - "source_id", - "result_name" + "cloneUrl" ], - "properties": { - "source_id": { - "description": "Source image id. This is the image id that is used in 'groups'.", - "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", - "type": "string" - }, - "result_name": { - "description": "Resultant image name.", - "example": "new-test-image", - "type": "string" - } - } - } + "additionalProperties": false } - } }, - "status": { - "type": "object", - "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", - "properties": { - "artifacts": { - "type": "array", - "items": { + "additionalProperties": false + } + }, + "V3ConfigurationDataCollection": { + "description": "A collection of configuration data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", "type": "object", "properties": { - "image_id": { - "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", - "description": "The IMS id of the original image to be customized via a configuration session.", - "format": "uuid", - "type": "string" - }, - "result_id": { - "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", - "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", - "format": "uuid", - "type": "string" - }, - "type": { - "example": "ims_customized_image", - "type": "string", - "enum": [ - "ims_customized_image" - ], - "default": "ims_customized_image" - } - } - } - }, - "session": { - "type": "object", - "properties": { - "job": { - "description": "The name of the configuration execution environment associated with this session.", - "example": "cray-cfs-job-session-20190728032600", - "readOnly": true, - "type": "string" - }, - "completionTime": { - "description": "The date/time when the session completed execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "startTime": { - "description": "The date/time when the session started execution in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "status": { - "description": "The execution status of the session.", - "enum": [ - "pending", - "running", - "complete" - ], - "readOnly": true, - "type": "string" + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } }, - "succeeded": { - "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", - "enum": [ - "none", - "true", - "false", - "unknown" - ], - "readOnly": true, - "type": "string" - } - } + "additionalProperties": false } - } }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", - "additionalProperties": { - "type": "string" - } + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true } - }, - "additionalProperties": false } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + }, + "V2ComponentsFilter": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" }, "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ] }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "configName": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." } - } } - } - } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + }, + "V3ComponentsFilter": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" }, "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured", + "" + ] }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "config_name": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." } - } } - } - } - } - } - }, - "delete": { - "summary": "Delete a configuration framework session", - "tags": [ - "sessions", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", - "operationId": "delete_session", - "description": "Deleting a configuration session deletes the Kubernetes objects associated with the session and also deletes the session history. The operation cannot be undone.", - "responses": { - "204": { - "description": "The resource was deleted." - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "V2ConfigurationStateLayer": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." } - } - } - } - } - } - } - }, - "parameters": [ - { - "name": "session_name", - "in": "path", - "description": "Config Framework Session name", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "/v2/components": { - "get": { - "summary": "Retrieve the state of a collection of components", - "tags": [ - "components", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Retrieve the full collection of components in the form of a ComponentArray. Full results can also be filtered by query parameters. Only the first filter parameter of each type is used and the parameters are applied in an AND fashion. If the collection is empty or the filters have no match, an empty array is returned.", - "operationId": "get_components", - "parameters": [ - { - "name": "ids", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Retrieve the components with the given id (e.g. xname for hardware components). Can be chained for selecting groups of components." - }, - { - "name": "status", - "schema": { - "type": "string", - "enum": [ - "unconfigured", - "failed", - "pending", - "configured" - ] - }, - "in": "query", - "description": "Retrieve the components with the status. Multiple statuses can be specified in a comma-separated list." - }, - { - "name": "enabled", - "schema": { - "type": "boolean" - }, - "in": "query", - "description": "Retrieve the components with the \"enabled\" state." - }, - { - "name": "configName", - "schema": { - "type": "string" - }, - "in": "query", - "description": "Retrieve the components with the given configuration set as the desired state." - }, - { - "name": "configDetails", - "schema": { - "type": "boolean" - }, - "in": "query", - "description": "Include the configuration and config status in the response" - }, - { - "name": "tags", - "schema": { - "type": "string" + }, + "additionalProperties": false }, - "in": "query", - "description": "Return only components whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be returned." - } - ], - "responses": { - "200": { - "description": "A collection of component states", - "content": { - "application/json": { - "schema": { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { + "V3ConfigurationStateLayer": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, - "additionalProperties": false - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "summary": "Add or Replace a collection of components", - "tags": [ - "components", - "v2", - "cli_ignore" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Update the state for a collection of components in the cfs database", - "operationId": "put_components", - "requestBody": { - "description": "The configuration/state for an array of components", - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "patch": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "V2ComponentState": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "type": "string", + "description": "The name of the CFS session that last configured the component." } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { "type": "string", "description": "The clone URL of the configuration content repository.", "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { + }, + "playbook": { "type": "string", "description": "The Ansible playbook to run.", "example": "site.yml" - }, - "commit": { + }, + "commit": { "type": "string", "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { + }, + "lastUpdated": { "type": "string", "description": "The date/time when the state was last updated in RFC 3339 format.", "example": "2019-07-28T03:26:00Z", "format": "date-time", "readOnly": true - }, - "sessionName": { + }, + "sessionName": { "type": "string", "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "type": "string", + "description": "The name of the CFS session that last configured the component." } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } + "additionalProperties": false }, - "additionalProperties": false - }, - "filters": { - "description": "Information for patching multiple components.", + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { "type": "object", - "properties": { - "ids": { - "type": "string", - "description": "A comma-separated list of component IDs" - }, - "status": { - "type": "string", - "description": "All components with this status will be patched.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ] - }, - "enabled": { - "type": "boolean", - "description": "Patches all components with the given \"enabled\" state." - }, - "configName": { - "type": "string", - "description": "A configuration name. All components with this configuration set will be patched." - }, - "tags": { - "type": "string", - "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." - } - } - } - }, - "required": [ - "patch", - "filters" - ] - }, - { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "V3ComponentData": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { "description": "The current configuration state for a component.\n", "type": "object", "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } }, "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { "type": "string", "description": "The clone URL of the configuration content repository.", "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { + }, + "playbook": { "type": "string", "description": "The Ansible playbook to run.", "example": "site.yml" - }, - "commit": { + }, + "commit": { "type": "string", "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { "type": "string", "description": "The date/time when the state was last updated in RFC 3339 format.", "example": "2019-07-28T03:26:00Z", "format": "date-time", "readOnly": true - }, - "sessionName": { + }, + "session_name": { "type": "string", "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "A collection of component states", - "content": { - "application/json": { - "schema": { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } }, "additionalProperties": false - }, - "desiredConfig": { + }, + "desired_config": { "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false + "additionalProperties": false }, "description": "Information about the desired config and status of the layers", "readOnly": true - }, - "errorCount": { + }, + "error_count": { "type": "integer", "description": "The count of failed configuration attempts." - }, - "retryPolicy": { + }, + "retry_policy": { "type": "integer", "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { + }, + "enabled": { "type": "boolean", "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { + }, + "configuration_status": { "type": "string", "description": "A summary of the component's configuration state.", "enum": [ - "unconfigured", - "pending", - "failed", - "configured" + "unconfigured", + "pending", + "failed", + "configured" ], "readOnly": true - }, - "tags": { + }, + "tags": { "type": "object", "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", "additionalProperties": { - "type": "string" + "type": "string" } - } - }, - "additionalProperties": false - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true } - } - } - } - } - } - } - }, - "patch": { - "summary": "Update a collection of components", - "tags": [ - "components", - "v2", - "cli_ignore" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Update the state for a collection of components in the cfs database", - "operationId": "patch_components", - "requestBody": { - "description": "The configuration/state for an array of components", - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "description": "Information for patching multiple components.", + }, + "additionalProperties": false + }, + "V2ComponentStateArray": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", "type": "object", "properties": { - "patch": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { + "id": { "type": "string", "description": "The component's id. e.g. xname for hardware components" - }, - "state": { + }, + "state": { "type": "array", "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true }, "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "type": "string", + "description": "The name of the CFS session that last configured the component." } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } }, "additionalProperties": false - }, - "desiredConfig": { + }, + "desiredConfig": { "type": "string", "description": "A reference to a configuration" - }, - "desiredState": { + }, + "desiredState": { "type": "array", "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + }, + "V3ComponentDataArray": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" }, "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" }, "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." } - }, - "additionalProperties": false + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false }, "description": "Information about the desired config and status of the layers", "readOnly": true - }, - "errorCount": { + }, + "error_count": { "type": "integer", "description": "The count of failed configuration attempts." - }, - "retryPolicy": { + }, + "retry_policy": { "type": "integer", "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { + }, + "enabled": { "type": "boolean", "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { + }, + "configuration_status": { "type": "string", "description": "A summary of the component's configuration state.", "enum": [ - "unconfigured", - "pending", - "failed", - "configured" + "unconfigured", + "pending", + "failed", + "configured" ], "readOnly": true - }, - "tags": { + }, + "tags": { "type": "object", "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", "additionalProperties": { - "type": "string" + "type": "string" } - } }, - "additionalProperties": false - }, - "filters": { - "description": "Information for patching multiple components.", - "type": "object", - "properties": { - "ids": { + "logs": { "type": "string", - "description": "A comma-separated list of component IDs" - }, - "status": { - "type": "string", - "description": "All components with this status will be patched.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ] - }, - "enabled": { - "type": "boolean", - "description": "Patches all components with the given \"enabled\" state." - }, - "configName": { - "type": "string", - "description": "A configuration name. All components with this configuration set will be patched." - }, - "tags": { - "type": "string", - "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." - } - } - } - }, - "required": [ - "patch", - "filters" - ] - }, - { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "V3ComponentDataCollection": { + "description": "A collection of component data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", "type": "object", "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + }, + "V3ComponentIdCollection": { + "description": "A collection of component ids.", + "type": "object", + "properties": { + "component_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "V2ComponentsUpdate": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } } - }, - "additionalProperties": false }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { + "description": "A comma-separated list of component IDs" + }, + "status": { "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "configName": { "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "description": "A configuration name. All components with this configuration set will be patched." }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } } - }, - "additionalProperties": false } - } + }, + "required": [ + "patch", + "filters" ] - } - } - } - }, - "responses": { - "200": { - "description": "A collection of component states", - "content": { - "application/json": { - "schema": { - "description": "An array of component configurations.", - "type": "array", - "items": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "V3ComponentsUpdate": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", "type": "object", "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured", + "" + ] }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "config_name": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + "ProblemDetails": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + }, + "paths": { + "/": { + "get": { + "summary": "Get API versions", + "description": "Return list of versions currently running.", + "tags": [ + "version" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.versions", + "operationId": "get_version", + "responses": { + "200": { + "description": "Version information for the service", + "content": { + "application/json": { + "schema": { + "description": "Version data", + "type": "object", + "properties": { + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "integer" + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "/versions": { + "get": { + "summary": "Get API versions", + "description": "Return list of versions currently running.", + "tags": [ + "version" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.versions", + "operationId": "get_versions", + "responses": { + "200": { + "description": "Version information for the service", + "content": { + "application/json": { + "schema": { + "description": "Version data", + "type": "object", + "properties": { + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "integer" + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "/healthz": { + "get": { + "summary": "Get service health details", + "tags": [ + "healthz" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.healthz", + "operationId": "get_healthz", + "description": "Get cfs-api health details.", + "responses": { + "200": { + "description": "Status information for the service", + "content": { + "application/json": { + "schema": { + "description": "Service health status", + "type": "object", + "properties": { + "db_status": { + "type": "string" + }, + "kafka_status": { + "type": "string" + } + }, + "additionalProperties": false + } + } } - } }, - "additionalProperties": false - } + "503": { + "description": "Status information for the service", + "content": { + "application/json": { + "schema": { + "description": "Service health status", + "type": "object", + "properties": { + "db_status": { + "type": "string" + }, + "kafka_status": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + } } - } } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "/v2": { + "get": { + "summary": "Get API versions", + "description": "Return list of versions currently running.", + "tags": [ + "version" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.versions", + "operationId": "get_versions_v2", + "responses": { + "200": { + "description": "Version information for the service", + "content": { + "application/json": { + "schema": { + "description": "Version data", + "type": "object", + "properties": { + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "integer" + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "/v2/options": { + "get": { + "summary": "Retrieve the configuration service options", + "tags": [ + "options", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.options", + "description": "Retrieve the list of configuration service options.", + "operationId": "get_options_v2", + "responses": { + "200": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardwareSyncInterval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 + }, + "batcherCheckInterval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 + }, + "batchSize": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 + }, + "batchWindow": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 + }, + "defaultBatcherRetryPolicy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 + }, + "defaultPlaybook": { + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "defaultAnsibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" + }, + "sessionTTL": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" + }, + "additionalInventoryUrl": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "batcherMaxBackoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 + }, + "batcherDisable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcherPendingTimeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + }, + "loggingLevel": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + } + } + } + } + } + }, + "patch": { + "summary": "Update configuration service options", + "tags": [ + "options", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.options", + "operationId": "patch_options_v2", + "description": "Update one or more of the configuration service options.", + "requestBody": { + "description": "Service-wide configuration options", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardwareSyncInterval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 + }, + "batcherCheckInterval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 + }, + "batchSize": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 + }, + "batchWindow": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 + }, + "defaultBatcherRetryPolicy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 + }, + "defaultPlaybook": { + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "defaultAnsibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" + }, + "sessionTTL": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" + }, + "additionalInventoryUrl": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "batcherMaxBackoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 + }, + "batcherDisable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcherPendingTimeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + }, + "loggingLevel": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardwareSyncInterval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5 + }, + "batcherCheckInterval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5 + }, + "batchSize": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120 + }, + "batchWindow": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120 + }, + "defaultBatcherRetryPolicy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1 + }, + "defaultPlaybook": { + "type": "string", + "description": "The default playbook to be used if not specified in a node's desired state.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "defaultAnsibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg" + }, + "sessionTTL": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h" + }, + "additionalInventoryUrl": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "batcherMaxBackoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600 + }, + "batcherDisable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcherPendingTimeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds)." + }, + "loggingLevel": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level." + } + }, + "additionalProperties": false + } + } + } }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "/v2/sessions": { + "get": { + "summary": "Retrieve configuration framework sessions", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "description": "Retrieve all the configuration framework sessions on the system.", + "operationId": "get_sessions_v2", + "parameters": [ + { + "name": "age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\" DEPRECATED: This field has been replaced by min_age and max_age" + }, + { + "name": "min_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" + }, + { + "name": "max_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" + }, + { + "name": "status", + "schema": { + "type": "string", + "enum": [ + "pending", + "running", + "complete" + ] + }, + "in": "query", + "description": "Return only sessions with the given status." }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + { + "name": "name_contains", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions whose session name contains the given string." }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + { + "name": "succeeded", + "schema": { + "type": "string", + "enum": [ + "none", + "true", + "false", + "unknown" + ] + }, + "in": "query", + "description": "Return only sessions that have succeeded/failed." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + { + "name": "tags", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be returned." + } + ], + "responses": { + "200": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "An array of sessions.", + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + } } - } } - } - } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + }, + "post": { + "summary": "Create a configuration framework session", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "create_session_v2", + "description": "Create a new configuration session. A configuration session stages Ansible inventory, launches one or more Ansible Execution Environments (AEE) as containers in the management services infrastructure, and tears down the environments as required. When a session is targeted for image customization, the inventory staging involves using IMS to expose the requested image roots, tearing down the image roots, and generating new boot artifacts afterwards. The session will checkout the prescribed branch or commit of the configuration repository and populate the configuration manifest to the AEE. The Ansible execution begins with an inventory prescribed by the user through CFS. A configuration session also tracks the status of the different stages of the operation and reports information on the success of its execution.", + "requestBody": { + "description": "A JSON object for creating Config Framework Sessions", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The information required to create a Config Framework Session.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configurationName": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config" + }, + "configurationLimit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansibleLimit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansibleConfig": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansibleVerbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansiblePassthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "name", + "configurationName" + ], + "additionalProperties": false + } + } + } + }, + "responses": { + "201": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "409": { + "description": "A session with the same name already exists.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - } - }, - "/v2/components/{component_id}": { - "get": { - "summary": "Retrieve the state of a single component", - "tags": [ - "components", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Retrieve the configuration and current state of a single component", - "operationId": "get_component", - "parameters": [ - { - "name": "configDetails", - "schema": { - "type": "boolean" }, - "in": "query", - "description": "Include the configuration and config status in the response" - } - ], - "responses": { - "200": { - "description": "A single component state", - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "delete": { + "summary": "Delete multiple configuration framework sessions", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "delete_sessions_v2", + "parameters": [ + { + "name": "age", + "schema": { + "type": "string" }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" + "in": "query", + "description": "Deletes only sessions older than the given age. Age is given in the format \"1d\" or \"6h\" DEPRECATED: This field has been replaced by min_age and max_age" }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + { + "name": "min_age", + "schema": { + "type": "string" }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false + "in": "query", + "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" + { + "name": "max_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { + { + "name": "status", + "schema": { "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "enum": [ + "pending", + "running", + "complete" + ], + "default": "complete" }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." + "in": "query", + "description": "Deletes only sessions with the given status." }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." + { + "name": "name_contains", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Delete only sessions whose session name contains the given string." }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." + { + "name": "succeeded", + "schema": { + "type": "string", + "enum": [ + "none", + "true", + "false", + "unknown" + ] + }, + "in": "query", + "description": "Delete only sessions that have succeeded/failed." }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true + { + "name": "tags", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be deleted." + } + ], + "description": "Delete multiple configuration sessions. If filters are provided, only sessions matching all filters will be deleted. By default only completed sessions will be deleted.", + "responses": { + "204": { + "description": "The resource was deleted." }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - }, - "additionalProperties": false } - } } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + }, + "/v2/sessions/{session_name}": { + "get": { + "summary": "Retrieve a configuration framework session by session_name", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "get_session_v2", + "description": "View details about a specific configuration session. This allows you to track the status of the session and the Ansible execution through the session.", + "responses": { + "200": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + }, + "patch": { + "summary": "Update a configuration framework session", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "patch_session_v2", + "description": "Update the status of an existing configuration framework session", + "responses": { + "200": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completionTime": { + "description": "The date/time when the session completed execution in RFC 3339 format. This has a null value when the session has not yet completed.", + "nullable": true, + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "put": { - "summary": "Add or Replace a single component", - "tags": [ - "components", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Update the state for a given component in the cfs database", - "operationId": "put_component", - "requestBody": { - "description": "The configuration/state for a single component", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + }, + "delete": { + "summary": "Delete a configuration framework session", + "tags": [ + "sessions", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "delete_session_v2", + "description": "Deleting a configuration session deletes the Kubernetes objects associated with the session and also deletes the session history. The operation cannot be undone.", + "responses": { + "204": { + "description": "The resource was deleted." }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } - }, - "additionalProperties": false - } - } - } + } + }, + "parameters": [ + { + "name": "session_name", + "in": "path", + "description": "Config Framework Session name", + "required": true, + "schema": { + "type": "string" + } + } + ] }, - "responses": { - "200": { - "description": "A single component state", - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" + "/v2/components": { + "get": { + "summary": "Retrieve the state of a collection of components", + "tags": [ + "components", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Retrieve the full collection of components in the form of a ComponentArray. Full results can also be filtered by query parameters. Only the first filter parameter of each type is used and the parameters are applied in an AND fashion. If the collection is empty or the filters have no match, an empty array is returned.", + "operationId": "get_components_v2", + "parameters": [ + { + "name": "ids", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Retrieve the components with the given id (e.g. xname for hardware components). Can be chained for selecting groups of components." }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { + { + "name": "status", + "schema": { "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "enum": [ + "unconfigured", + "failed", + "pending", + "configured" + ] }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" + "in": "query", + "description": "Retrieve the components with the status. Multiple statuses can be specified in a comma-separated list." }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" + { + "name": "enabled", + "schema": { + "type": "boolean" }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false + "in": "query", + "description": "Retrieve the components with the \"enabled\" state." }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + { + "name": "configName", + "schema": { + "type": "string" }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." + "in": "query", + "description": "Retrieve the components with the given configuration set as the desired state." }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." + { + "name": "configDetails", + "schema": { + "type": "boolean" + }, + "in": "query", + "description": "Include the configuration and config status in the response" }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true + { + "name": "tags", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only components whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be returned." + } + ], + "responses": { + "200": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + } }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" - } + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - }, - "additionalProperties": false } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + }, + "put": { + "summary": "Add or Replace a collection of components", + "tags": [ + "components", + "v2", + "cli_ignore" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a collection of components in the cfs database", + "operationId": "put_components_v2", + "requestBody": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "configName": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + } }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update a collection of components", + "tags": [ + "components", + "v2", + "cli_ignore" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a collection of components in the cfs database", + "operationId": "patch_components_v2", + "requestBody": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "configName": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } } - } - } - }, - "patch": { - "summary": "Update a single component", - "tags": [ - "components", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Update the state for a given component in the cfs database", - "operationId": "patch_component", - "requestBody": { - "description": "The configuration/state for a single component", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" - }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + }, + "/v2/components/{component_id}": { + "get": { + "summary": "Retrieve the state of a single component", + "tags": [ + "components", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Retrieve the configuration and current state of a single component", + "operationId": "get_component_v2", + "parameters": [ + { + "name": "configDetails", + "schema": { + "type": "boolean" }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "in": "query", + "description": "Include the configuration and config status in the response" + } + ], + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } } - }, - "additionalProperties": false }, - "description": "Information about the desired config and status of the layers" - }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "additionalProperties": false - }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" - }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true - }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." - }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." - }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." - }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true - }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Add or Replace a single component", + "tags": [ + "components", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a given component in the cfs database", + "operationId": "put_component_v2", + "requestBody": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } } - } }, - "additionalProperties": false - } - } - } - }, - "responses": { - "200": { - "description": "A single component state", - "content": { - "application/json": { - "schema": { - "description": "The configuration state and desired state for a component.\n", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The component's id. e.g. xname for hardware components" + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "state": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } - }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update a single component", + "tags": [ + "components", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a given component in the cfs database", + "operationId": "patch_component_v2", + "requestBody": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "stateAppend": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desiredConfig": { + "type": "string", + "description": "A reference to a configuration" + }, + "desiredState": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "sessionName": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "errorCount": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retryPolicy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configurationStatus": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } }, - "stateAppend": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } } - }, - "additionalProperties": false }, - "desiredConfig": { - "type": "string", - "description": "A reference to a configuration" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "components", + "v2", + "cli_ignore" + ], + "summary": "Delete a single component", + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Delete the given component", + "operationId": "delete_component_v2", + "responses": { + "204": { + "description": "The resource was deleted." }, - "desiredState": { - "type": "array", - "items": { - "description": "The current configuration state for a component.\n", - "type": "object", - "properties": { - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "sessionName": { - "type": "string", - "description": "The name of the CFS session that last configured the component." - } + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "component_id", + "in": "path", + "description": "Component id. e.g. xname for hardware components", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/v2/configurations": { + "get": { + "summary": "Retrieve a collection of configurations", + "tags": [ + "configurations", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Retrieve the full collection of configurations in the form of a ConfigurationArray.", + "operationId": "get_configurations_v2", + "parameters": [ + { + "name": "in_use", + "schema": { + "type": "boolean" }, - "additionalProperties": false - }, - "description": "Information about the desired config and status of the layers", - "readOnly": true + "in": "query", + "description": "Query for only configurations that are currently referenced by components." + } + ], + "responses": { + "200": { + "description": "A collection of configurations", + "content": { + "application/json": { + "schema": { + "description": "An array of configurations.", + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + } }, - "errorCount": { - "type": "integer", - "description": "The count of failed configuration attempts." + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "/v2/configurations/{configuration_id}": { + "get": { + "summary": "Retrieve a single configuration", + "tags": [ + "configurations", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Retrieve the given configuration", + "operationId": "get_configuration_v2", + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "retryPolicy": { - "type": "integer", - "description": "The maximum number retries per component when configuration fails." + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Add or Replace a single configuration", + "tags": [ + "configurations", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Add a configuration to CFS or replace an existing configuration.", + "operationId": "put_configuration_v2", + "requestBody": { + "description": "A desired configuration state", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "enabled": { - "type": "boolean", - "description": "A flag indicating if the component should be scheduled for configuration." + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update the commits for a configuration", + "tags": [ + "configurations", + "v2" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Updates the commits for all layers that specify a branch", + "operationId": "patch_configuration_v2", + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "lastUpdated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + }, + "specialParameters": { + "type": "object", + "description": "Optional parameters that do not affect the configuration content or are only used in\nspecial circumstances.\n", + "properties": { + "imsRequireDkms": { + "type": "boolean", + "description": "If true, any image customization sessions that use this configuration will enable DKMS in IMS.\n" + } + }, + "additionalProperties": false + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory" + }, + "cloneUrl": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "cloneUrl" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "configurationStatus": { - "type": "string", - "description": "A summary of the component's configuration state.", - "enum": [ - "unconfigured", - "pending", - "failed", - "configured" - ], - "readOnly": true + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "configurations", + "v2" + ], + "summary": "Delete a single configuration", + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Delete the given configuration. This will fail in any components are using the specified configuration.", + "operationId": "delete_configuration_v2", + "responses": { + "204": { + "description": "The resource was deleted." }, - "tags": { - "type": "object", - "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", - "additionalProperties": { + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + }, + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "configuration_id", + "in": "path", + "description": "Name of the target configuration", + "required": true, + "schema": { "type": "string" - } } - }, - "additionalProperties": false } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + ] + }, + "/v3": { + "get": { + "summary": "Get API versions", + "description": "Return list of versions currently running.", + "tags": [ + "version" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.versions", + "operationId": "get_versions_v3", + "responses": { + "200": { + "description": "Version information for the service", + "content": { + "application/json": { + "schema": { + "description": "Version data", + "type": "object", + "properties": { + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "patch": { + "type": "integer" + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "/v3/options": { + "get": { + "summary": "Retrieve the configuration service options", + "tags": [ + "options", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.options", + "description": "Retrieve the list of configuration service options.", + "operationId": "get_options_v3", + "responses": { + "200": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } + }, + "additionalProperties": false + } + } + } + } + } + }, + "patch": { + "summary": "Update configuration service options", + "tags": [ + "options", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.options", + "operationId": "patch_options_v3", + "description": "Update one or more of the configuration service options.", + "requestBody": { + "description": "Service-wide configuration options", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A collection of service-wide configuration options", + "content": { + "application/json": { + "schema": { + "description": "Configuration options for the configuration service.\n", + "type": "object", + "properties": { + "hardware_sync_interval": { + "type": "integer", + "description": "How frequently the CFS hardware-sync-agent checks with the Hardware State Manager to update its known hardware (in seconds)", + "example": 5, + "minimum": 1 + }, + "batcher_check_interval": { + "type": "integer", + "description": "How frequently the batcher checks the configuration states to see if work needs to be done (in seconds)", + "example": 5, + "minimum": 1 + }, + "batch_size": { + "type": "integer", + "description": "The maximum number of nodes the batcher will run a single CFS session against.", + "example": 120, + "minimum": 1 + }, + "batch_window": { + "type": "integer", + "description": "The maximum number of seconds the batcher will wait to run a CFS session once a node has been detected that needs configuration.", + "example": 120, + "minimum": 0 + }, + "default_batcher_retry_policy": { + "type": "integer", + "description": "The default maximum number retries per node when configuration fails.", + "example": 1, + "minimum": 0 + }, + "default_playbook": { + "type": "string", + "description": "[DEPRECATED] The default playbook to be used if not specified in a node's desired state. This option is read-only via the v3 API and remains only for compatibility with the v2 API. This option will be removed from v3 when the v2 API is removed.\n", + "example": "site.yml", + "pattern": "^[^\\s;]*$", + "deprecated": true, + "readOnly": true + }, + "default_ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the default ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service.", + "example": "cfs-default-ansible-cfg", + "minLength": 0, + "maxLength": 60 + }, + "session_ttl": { + "type": "string", + "description": "A time-to-live applied to all completed CFS sessions. Specified in hours or days. e.g. 3d or 24h. Set to an empty string to disable.", + "example": "24h", + "minLength": 0, + "maxLength": 10 + }, + "additional_inventory_url": { + "type": "string", + "description": "The git clone URL of a repo with additional inventory files. All files in the repo will be copied into the hosts directory of CFS.\n", + "example": "https://api-gw-service-nmn.local/vcs/cray/inventory.git", + "pattern": "^[^\\s;]*$", + "minLength": 1, + "maxLength": 120 + }, + "batcher_max_backoff": { + "type": "integer", + "description": "The maximum number of seconds that batcher will backoff from session creation if problems are detected.\n", + "example": 3600, + "minimum": 0 + }, + "batcher_disable": { + "type": "boolean", + "description": "Disables cfs-batcher's automatic session creation if set to True." + }, + "batcher_pending_timeout": { + "type": "integer", + "description": "How long cfs-batcher will wait on a pending session before deleting and recreating it (in seconds).", + "minimum": 1 + }, + "logging_level": { + "type": "string", + "description": "The logging level for core CFS services. This does not affect the Ansible logging level.", + "enum": [ + "DEBUG", + "INFO", + "WARNING", + "ERROR" + ] + }, + "default_page_size": { + "type": "integer", + "description": "The maximum number of results that a query will return if the limit parameter is not specified.", + "minimum": 1 + }, + "debug_wait_time": { + "type": "integer", + "description": "The number of seconds CFS sessions will wait after failure for debugging when debug_on_failure is true.", + "minimum": 0 + }, + "include_ara_links": { + "type": "boolean", + "description": "If true, session and component records will include links to ARA dashboards for the logs" + } + }, + "additionalProperties": false + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + }, + "/v3/sessions": { + "get": { + "summary": "Retrieve configuration framework sessions", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "description": "Retrieve all the configuration framework sessions on the system.", + "operationId": "get_sessions_v3", + "parameters": [ + { + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1 + }, + "in": "query", + "description": "When set, CFS will only return a number of sessions up to this limit. Combined with after_id, this enables paging across results" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + { + "name": "after_id", + "schema": { + "type": "string" + }, + "in": "query", + "description": "When set, CFS will only return the sessions after the session specified. Combined with limit, this enables paging across results." }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + { + "name": "min_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "tags": [ - "components", - "v2", - "cli_ignore" - ], - "summary": "Delete a single component", - "x-openapi-router-controller": "cray.cfs.api.controllers.components", - "description": "Delete the given component", - "operationId": "delete_component", - "responses": { - "204": { - "description": "The resource was deleted." - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + { + "name": "max_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + { + "name": "status", + "schema": { + "type": "string", + "enum": [ + "pending", + "running", + "complete", + "" + ] + }, + "in": "query", + "description": "Return only sessions with the given status." }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + { + "name": "name_contains", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions whose session name contains the given string." }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + { + "name": "succeeded", + "schema": { + "type": "string", + "enum": [ + "none", + "true", + "false", + "unknown", + "" + ] + }, + "in": "query", + "description": "Return only sessions that have succeeded/failed." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + { + "name": "tags", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be returned." + } + ], + "responses": { + "200": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } + } } - } } - } - } - } - } - }, - "parameters": [ - { - "name": "component_id", - "in": "path", - "description": "Component id. e.g. xname for hardware components", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, - "/v2/configurations": { - "get": { - "summary": "Retrieve a collection of configurations", - "tags": [ - "configurations", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", - "description": "Retrieve the full collection of configurations in the form of a ConfigurationArray.", - "operationId": "get_configurations", - "parameters": [ - { - "name": "in_use", - "schema": { - "type": "boolean" }, - "in": "query", - "description": "Query for only configurations that are currently referenced by components." - } - ], - "responses": { - "200": { - "description": "A collection of configurations", - "content": { - "application/json": { - "schema": { - "description": "An array of configurations.", - "type": "array", - "items": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" + "post": { + "summary": "Create a configuration framework session", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "create_session_v3", + "description": "Create a new configuration session. A configuration session stages Ansible inventory, launches one or more Ansible Execution Environments (AEE) as containers in the management services infrastructure, and tears down the environments as required. When a session is targeted for image customization, the inventory staging involves using IMS to expose the requested image roots, tearing down the image roots, and generating new boot artifacts afterwards. The session will checkout the prescribed branch or commit of the configuration repository and populate the configuration manifest to the AEE. The Ansible execution begins with an inventory prescribed by the user through CFS. A configuration session also tracks the status of the different stages of the operation and reports information on the success of its execution.", + "requestBody": { + "description": "A JSON object for creating Config Framework Sessions", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The information required to create a Config Framework Session.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration_name": { + "type": "string", + "description": "The name of a CFS configuration to apply", + "example": "example-config", + "minLength": 1, + "maxLength": 60 + }, + "configuration_limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3", + "default": "" + }, + "ansible_limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "pattern": "^[^\\s;]*$" + }, + "ansible_config": { + "type": "string", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "ansible_verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "ansible_passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs." + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + } + }, + "required": [ + "name", + "configuration_name" + ], + "additionalProperties": false + } + } + } + }, + "responses": { + "201": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "409": { + "description": "A session with the same name already exists.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - } - }, - "/v2/configurations/{configuration_id}": { - "get": { - "summary": "Retrieve a single configuration", - "tags": [ - "configurations", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", - "description": "Retrieve the given configuration", - "operationId": "get_configuration", - "responses": { - "200": { - "description": "A single configuration", - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." + }, + "delete": { + "summary": "Delete multiple configuration framework sessions", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "delete_sessions_v3", + "parameters": [ + { + "name": "min_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions older than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + { + "name": "max_age", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only sessions younger than the given age. Age is given in the format \"1d\" or \"6h\"" }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { + { + "name": "status", + "schema": { "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } + "enum": [ + "pending", + "running", + "complete", + "" + ], + "default": "complete" }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } + "in": "query", + "description": "Deletes only sessions with the given status." }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" + { + "name": "name_contains", + "schema": { + "type": "string" }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" + "in": "query", + "description": "Delete only sessions whose session name contains the given string." + }, + { + "name": "succeeded", + "schema": { + "type": "string", + "enum": [ + "none", + "true", + "false", + "unknown", + "" + ] }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" + "in": "query", + "description": "Delete only sessions that have succeeded/failed." + }, + { + "name": "tags", + "schema": { + "type": "string" }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false + "in": "query", + "description": "Return only sessions whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only sessions that match all tags will be deleted." + } + ], + "description": "Delete multiple configuration sessions. If filters are provided, only sessions matching all filters will be deleted. By default only completed sessions will be deleted.", + "responses": { + "200": { + "description": "A collection of configuration sessions", + "content": { + "application/json": { + "schema": { + "description": "A collection of session data.", + "type": "object", + "properties": { + "session_ids": { + "type": "array", + "items": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } } - } } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + }, + "/v3/sessions/{session_name}": { + "get": { + "summary": "Retrieve a configuration framework session by session_name", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "get_session_v3", + "description": "View details about a specific configuration session. This allows you to track the status of the session and the Ansible execution through the session.", + "responses": { + "200": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update a configuration framework session", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "patch_session_v3", + "description": "Update the status of an existing configuration framework session", + "responses": { + "200": { + "description": "A single configuration session", + "content": { + "application/json": { + "schema": { + "description": "An execution session for the Configuration Framework.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the session. The length of the name is restricted to 45 characters.", + "example": "session-20190728032600", + "minLength": 1, + "maxLength": 45, + "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" + }, + "configuration": { + "type": "object", + "description": "The configuration information which the session will apply", + "properties": { + "name": { + "type": "string", + "description": "The name of the CFS configuration to be applied", + "example": "example-config" + }, + "limit": { + "type": "string", + "description": "A comma separated list of layers in the configuration to limit the session to. This can be either a list of named layers, or a list of indices.", + "example": "layer1,layer3" + } + } + }, + "ansible": { + "type": "object", + "description": "Additional options that will be used when invoking Ansible.", + "properties": { + "config": { + "type": "string", + "default": "cfs-default-ansible-cfg", + "description": "The Kubernetes ConfigMap which holds the ansible.cfg for a given CFS session. This ConfigMap must be present in the same Kubernetes namespace as the CFS service. If no value is given, the value of the defaultAnsibleConfig field in the /options endpoint will be used.", + "example": "cfs-default-ansible-cfg" + }, + "limit": { + "type": "string", + "description": "Additional filtering of hosts or groups from the inventory to run against. This is especially useful when running with dynamic inventory and when you want to run on a subset of nodes or groups. This option corresponds to ansible-playbook's --limit and can be used to specify nodes or groups.", + "example": "host1", + "nullable": true + }, + "verbosity": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 4, + "description": "The verbose mode to use in the call to the ansible-playbook command. 1 = -v, 2 = -vv, etc. Valid values range from 0 to 4. See the ansible-playbook help for more information." + }, + "passthrough": { + "type": "string", + "description": "Additional parameters that are added to all Ansible calls for the session. This field is currently limited to the following Ansible parameters: \"--extra-vars\", \"--forks\", \"--skip-tags\", \"--start-at-task\", and \"--tags\". WARNING: Parameters passed to Ansible in this way should be used with caution. State will not be recorded for components when using these flags to avoid incorrect reporting of partial playbook runs.", + "nullable": true + } + } + }, + "target": { + "type": "object", + "description": "A target lets you define the nodes or images that you want to customize and consists of two sub-parameters - Definition and groups. By default, Configuration Framework Sessions use dynamic inventory definition to target hosts. When using a session to customize an image, or if a static inventory is required, use this optional section to specify entities (whether images or nodes) for the session to target.\n", + "properties": { + "definition": { + "type": "string", + "description": "Source of inventory definition to be used in the configuration session.\n\n'image' denotes that the session will target an image root through the Image\nManagement Service (IMS). Group members should be a single image identifier known by IMS.\n\n'spec' denotes inventory that is specified directly via CFS in the target\ngroups/members of this object. You can include a node name (a DNS resolvable name),\nor a group name and a list of nodes. The command line inventory can be a quick\nand simple way to run Ansible against a small subset of nodes. However, if more\ncustomization of the inventory is needed, specifically customization of host and\ngroups variables, the repo target definition should be used.\n\n'repo' denotes the inventory will be used from the git repository\nspecified for this session (via `cloneUrl`, and `branch` or `commit`). The inventory\nmust be located in the \"hosts\" file at the root of the repository.\n\n'dynamic' (default) will use the CFS-provided dynamic inventory plugin to define\nthe inventory. The hosts file is automatically generated by CFS with data from\nthe Hardware State Manager (HSM), which includes groups and hardware roles.\n", + "enum": [ + "image", + "spec", + "repo", + "dynamic" + ], + "default": "dynamic", + "example": "spec" + }, + "groups": { + "type": "array", + "description": "Specification of the groups and group members per the inventory definition. This list is not valid for the 'repo' and 'dynamic' inventory definition types. Multiple groups can be specified for 'image' and 'spec' inventory definition types.", + "items": { + "type": "object", + "required": [ + "name", + "members" + ], + "properties": { + "name": { + "description": "Group name", + "example": "test-computes", + "type": "string" + }, + "members": { + "description": "Group members for the inventory.\n", + "type": "array", + "example": [ + "nid000001", + "nid000002", + "nid000003" + ], + "items": { + "type": "string" + } + } + } + } + }, + "image_map": { + "type": "array", + "description": "Mapping of image IDs to resultant image names. This is only valid for 'image' inventory definition types.\nOnly images that are defined in 'groups' will result in a new image.\nIf images in 'groups' are not specified here, CFS will generate a name for the resultant image.\n", + "items": { + "type": "object", + "required": [ + "source_id", + "result_name" + ], + "properties": { + "source_id": { + "description": "Source image id. This is the image id that is used in 'groups'.", + "example": "ff287206-6ff7-4659-92ad-6e732821c6b4", + "type": "string" + }, + "result_name": { + "description": "Resultant image name.", + "example": "new-test-image", + "type": "string" + } + } + } + } + } + }, + "status": { + "type": "object", + "description": "Status of artifacts, session, and targets. Lists details like session status, session start and completion time, number of successful, failed, or running targets. If the target definition is an image, it also lists the image_id, result_id, and type of image under Artifacts.", + "properties": { + "artifacts": { + "type": "array", + "description": "Status of artifacts", + "items": { + "type": "object", + "properties": { + "image_id": { + "example": "f34ff35e-d782-4a65-a1b8-243a3cd740af", + "description": "The IMS id of the original image to be customized via a configuration session.", + "format": "uuid", + "type": "string" + }, + "result_id": { + "example": "8b782ccd-8706-4145-a6a1-724e29ed5522", + "description": "The IMS id of the image that was customized via a configuration session. This is the resultant image of the customization.", + "format": "uuid", + "type": "string" + }, + "type": { + "example": "ims_customized_image", + "type": "string", + "enum": [ + "ims_customized_image" + ] + } + } + } + }, + "session": { + "type": "object", + "description": "Status of session", + "properties": { + "job": { + "description": "The name of the configuration execution environment associated with this session.", + "example": "cray-cfs-job-session-20190728032600", + "readOnly": true, + "type": "string" + }, + "completion_time": { + "description": "The date/time when the session completed execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "start_time": { + "description": "The date/time when the session started execution in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "status": { + "description": "The execution status of the session.", + "enum": [ + "pending", + "running", + "complete" + ], + "readOnly": true, + "type": "string" + }, + "succeeded": { + "description": "Whether the session executed successfully or not. A 'none'\nvalue denotes that the execution has not completed. This\nfield has context when the `status` field is 'complete'.\nA session may successfully execute even if the underlying\ntasks do not.\n", + "enum": [ + "none", + "true", + "false", + "unknown" + ], + "readOnly": true, + "type": "string" + } + } + } + } + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the session, such as information about the session creator.", + "additionalProperties": { + "type": "string" + } + }, + "debug_on_failure": { + "type": "boolean", + "description": "When true, the ansible container for the session will remain running after an Ansible failure. The container will remain running for a number of seconds specified by the debug_wait_time options, or until complete flag is touched.", + "default": false + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "put": { - "summary": "Add or Replace a single configuration", - "tags": [ - "configurations", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", - "description": "Add a configuration to CFS or replace an existing configuration.", - "operationId": "put_configuration", - "requestBody": { - "description": "A desired configuration state", - "required": true, - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true - }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." - }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true - }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } + }, + "delete": { + "summary": "Delete a configuration framework session", + "tags": [ + "sessions", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.sessions", + "operationId": "delete_session_v3", + "description": "Deleting a configuration session deletes the Kubernetes objects associated with the session and also deletes the session history. The operation cannot be undone.", + "responses": { + "204": { + "description": "The resource was deleted." }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "session_name", + "in": "path", + "description": "Config Framework Session name", + "required": true, + "schema": { + "type": "string" + } + } + ] }, - "responses": { - "200": { - "description": "A single configuration", - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true + "/v3/components": { + "get": { + "summary": "Retrieve the state of a collection of components", + "tags": [ + "components", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Retrieve the full collection of components in the form of a ComponentArray. Full results can also be filtered by query parameters. Only the first filter parameter of each type is used and the parameters are applied in an AND fashion. If the collection is empty or the filters have no match, an empty array is returned.", + "operationId": "get_components_v3", + "parameters": [ + { + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1 + }, + "in": "query", + "description": "When set, CFS will only return a number of components up to this limit. Combined with after_id, this enables paging across results" }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." + { + "name": "after_id", + "schema": { + "type": "string" + }, + "in": "query", + "description": "When set, CFS will only return the components after the component specified. Combined with limit, this enables paging across results." }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + { + "name": "ids", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Retrieve the components with the given id (e.g. xname for hardware components). Can be chained for selecting groups of components." }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { + { + "name": "status", + "schema": { "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } + "enum": [ + "unconfigured", + "failed", + "pending", + "configured", + "" + ] }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } + "in": "query", + "description": "Retrieve the components with the status. Multiple statuses can be specified in a comma-separated list." }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" + { + "name": "enabled", + "schema": { + "type": "boolean" }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" + "in": "query", + "description": "Retrieve the components with the \"enabled\" state." + }, + { + "name": "config_name", + "schema": { + "type": "string" }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + "in": "query", + "description": "Retrieve the components with the given configuration set as the desired state." }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + { + "name": "state_details", + "schema": { + "type": "boolean" + }, + "in": "query", + "description": "Include the details on the currently applied layers" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + { + "name": "config_details", + "schema": { + "type": "boolean" + }, + "in": "query", + "description": "Include the configuration and config status in the response" }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + { + "name": "tags", + "schema": { + "type": "string" + }, + "in": "query", + "description": "Return only components whose have the matching tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be returned." + } + ], + "responses": { + "200": { + "description": "A collection of component states", + "content": { + "application/json": { + "schema": { + "description": "A collection of component data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "patch": { - "summary": "Update the commits for a configuration", - "tags": [ - "configurations", - "v2" - ], - "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", - "description": "Updates the commits for all layers that specify a branch", - "operationId": "patch_configuration", - "responses": { - "200": { - "description": "A single configuration", - "content": { - "application/json": { - "schema": { - "description": "A collection of ConfigurationLayers.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration.", - "example": "sample-config", - "readOnly": true + }, + "put": { + "summary": "Add or Replace a collection of components", + "tags": [ + "components", + "v3", + "cli_ignore" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a collection of components in the cfs database", + "operationId": "put_components_v3", + "requestBody": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured", + "" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "config_name": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A collection of component ids", + "content": { + "application/json": { + "schema": { + "description": "A collection of component ids.", + "type": "object", + "properties": { + "component_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } }, - "description": { - "type": "string", - "description": "A user-defined description. This field is not used by CFS." + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update a collection of components", + "tags": [ + "components", + "v3", + "cli_ignore" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a collection of components in the cfs database", + "operationId": "patch_components_v3", + "requestBody": { + "description": "The configuration/state for an array of components", + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "patch": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + }, + "filters": { + "description": "Information for patching multiple components.", + "type": "object", + "properties": { + "ids": { + "type": "string", + "description": "A comma-separated list of component IDs" + }, + "status": { + "type": "string", + "description": "All components with this status will be patched.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured", + "" + ] + }, + "enabled": { + "type": "boolean", + "description": "Patches all components with the given \"enabled\" state." + }, + "config_name": { + "type": "string", + "description": "A configuration name. All components with this configuration set will be patched." + }, + "tags": { + "type": "string", + "description": "Patches all components with the given tags. Key-value pairs should be separated using =, and tags can be a comma-separated list. Only components that match all tags will be patched." + } + } + } + }, + "required": [ + "patch", + "filters" + ] + }, + { + "description": "An array of component configurations.", + "type": "array", + "items": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A collection of component ids", + "content": { + "application/json": { + "schema": { + "description": "A collection of component ids.", + "type": "object", + "properties": { + "component_ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } }, - "lastUpdated": { - "type": "string", - "description": "The date/time when the state was last updated in RFC 3339 format.", - "example": "2019-07-28T03:26:00Z", - "format": "date-time", - "readOnly": true + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "layers": { - "type": "array", - "description": "A list of ConfigurationLayer(s).", - "items": { - "description": "A single desired configuration state for a component.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the configuration layer.", - "example": "sample-config" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", - "pattern": "^[^\\s;]*$" - }, - "playbook": { - "type": "string", - "description": "The Ansible playbook to run.", - "example": "site.yml", - "pattern": "^[^\\s;]*$" - }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "/v3/components/{component_id}": { + "get": { + "summary": "Retrieve the state of a single component", + "tags": [ + "components", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Retrieve the configuration and current state of a single component", + "operationId": "get_component_v3", + "parameters": [ + { + "name": "state_details", + "schema": { + "type": "boolean" }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } + "in": "query", + "description": "Include the details on the currently applied layers" }, - "additional_inventory": { - "description": "An inventory reference to include in a set of configurations.\n", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inventory layer.", - "example": "sample-inventory" - }, - "cloneUrl": { - "type": "string", - "description": "The clone URL of the configuration content repository.", - "example": "https://vcs.domain/vcs/org/inventory.git", - "pattern": "^[^\\s;]*$" + { + "name": "config_details", + "schema": { + "type": "boolean" }, - "commit": { - "type": "string", - "description": "The commit hash of the configuration repository when the state is set.", - "pattern": "^[a-f0-9]{40}$" - }, - "branch": { - "type": "string", - "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", - "pattern": "^[^\\s;]*$" - } - }, - "required": [ - "cloneUrl" - ], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + "in": "query", + "description": "Include the configuration and config status in the response" + } + ], + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Add or Replace a single component", + "tags": [ + "components", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a given component in the cfs database", + "operationId": "put_component_v3", + "requestBody": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update a single component", + "tags": [ + "components", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Update the state for a given component in the cfs database", + "operationId": "patch_component_v3", + "requestBody": { + "description": "The configuration/state for a single component", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A single component state", + "content": { + "application/json": { + "schema": { + "description": "The configuration state and desired state for a component.\n", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The component's id. e.g. xname for hardware components" + }, + "state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers" + }, + "state_append": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "desired_config": { + "type": "string", + "description": "A reference to a configuration", + "minLength": 1, + "maxLength": 60 + }, + "desired_state": { + "type": "array", + "items": { + "description": "The current configuration state for a component.\n", + "type": "object", + "properties": { + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set." + }, + "status": { + "type": "string", + "description": "The status of the configuration layer.", + "enum": [ + "applied", + "failed", + "skipped" + ] + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "session_name": { + "type": "string", + "description": "The name of the CFS session that last configured the component." + } + }, + "additionalProperties": false + }, + "description": "Information about the desired config and status of the layers", + "readOnly": true + }, + "error_count": { + "type": "integer", + "description": "The count of failed configuration attempts." + }, + "retry_policy": { + "type": "integer", + "description": "The maximum number retries per component when configuration fails." + }, + "enabled": { + "type": "boolean", + "description": "A flag indicating if the component should be scheduled for configuration." + }, + "configuration_status": { + "type": "string", + "description": "A summary of the component's configuration state.", + "enum": [ + "unconfigured", + "pending", + "failed", + "configured" + ], + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A collection of key-value pairs containing descriptive information for the component, such as information about the component owner.", + "additionalProperties": { + "type": "string" + } + }, + "logs": { + "type": "string", + "description": "The link to the ARA UI with logs for this component", + "readOnly": true + } + }, + "additionalProperties": false + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + }, + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "delete": { - "tags": [ - "configurations", - "v2" - ], - "summary": "Delete a single configuration", - "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", - "description": "Delete the given configuration. This will fail in any components are using the specified configuration.", - "operationId": "delete_configuration", - "responses": { - "204": { - "description": "The resource was deleted." - }, - "400": { - "description": "Bad Request", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "delete": { + "tags": [ + "components", + "v3", + "cli_ignore" + ], + "summary": "Delete a single component", + "x-openapi-router-controller": "cray.cfs.api.controllers.components", + "description": "Delete the given component", + "operationId": "delete_component_v3", + "responses": { + "204": { + "description": "The resource was deleted." }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "component_id", + "in": "path", + "description": "Component id. e.g. xname for hardware components", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/v3/configurations": { + "get": { + "summary": "Retrieve a collection of configurations", + "tags": [ + "configurations", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Retrieve the full collection of configurations in the form of a ConfigurationArray.", + "operationId": "get_configurations_v3", + "parameters": [ + { + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1 + }, + "in": "query", + "description": "When set, CFS will only return a number of configurations up to this limit. Combined with after_id, this enables paging across results" }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + { + "name": "after_id", + "schema": { + "type": "string" + }, + "in": "query", + "description": "When set, CFS will only return the configurations after the configuration specified. Combined with limit, this enables paging across results." }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + { + "name": "in_use", + "schema": { + "type": "boolean" + }, + "in": "query", + "description": "Query for only configurations that are currently referenced by components." + } + ], + "responses": { + "200": { + "description": "A collection of configurations", + "content": { + "application/json": { + "schema": { + "description": "A collection of configuration data.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "next": { + "description": "Information for requesting the next page of data", + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "after_id": { + "type": "string" + } + }, + "additionalProperties": true + } + } + } + } + } }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } } - }, - "404": { - "description": "The resource was not found.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "type": { - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "type": "string", - "format": "uri", - "default": "about:blank" + }, + "/v3/configurations/{configuration_id}": { + "get": { + "summary": "Retrieve a single configuration", + "tags": [ + "configurations", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Retrieve the given configuration", + "operationId": "get_configuration_v3", + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Add or Replace a single configuration", + "tags": [ + "configurations", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Add a configuration to CFS or replace an existing configuration.", + "operationId": "put_configuration_v3", + "requestBody": { + "description": "A desired configuration state", + "required": true, + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "status": { - "description": "HTTP status code", - "type": "integer", - "example": 400 + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "summary": "Update the commits for a configuration", + "tags": [ + "configurations", + "v3" + ], + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Updates the commits for all layers that specify a branch", + "operationId": "patch_configuration_v3", + "responses": { + "200": { + "description": "A single configuration", + "content": { + "application/json": { + "schema": { + "description": "A collection of ConfigurationLayers.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration.", + "example": "sample-config", + "readOnly": true + }, + "description": { + "type": "string", + "description": "A user-defined description. This field is not used by CFS." + }, + "last_updated": { + "type": "string", + "description": "The date/time when the state was last updated in RFC 3339 format.", + "example": "2019-07-28T03:26:00Z", + "format": "date-time", + "readOnly": true + }, + "layers": { + "type": "array", + "description": "A list of ConfigurationLayer(s).", + "items": { + "description": "A single desired configuration state for a component.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the configuration layer.", + "example": "sample-config", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://api-gw-service-nmn.local/vcs/cray/config-management.git", + "pattern": "^[^\\s;]*$" + }, + "playbook": { + "type": "string", + "description": "The Ansible playbook to run.", + "example": "site.yml", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The configuration branch to use. This will automatically set commit to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url", + "playbook" + ], + "additionalProperties": false + } + }, + "additional_inventory": { + "description": "An inventory reference to include in a set of configurations.\n", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inventory layer.", + "example": "sample-inventory", + "minLength": 1, + "maxLength": 45 + }, + "clone_url": { + "type": "string", + "description": "The clone URL of the configuration content repository.", + "example": "https://vcs.domain/vcs/org/inventory.git", + "pattern": "^[^\\s;]*$" + }, + "commit": { + "type": "string", + "description": "The commit hash of the configuration repository when the state is set.", + "pattern": "^[a-f0-9]{40}$" + }, + "branch": { + "type": "string", + "description": "The repository branch to use. This will automatically set `commit` to master on the branch\nwhen the configuration is added.\n", + "pattern": "^[^\\s;]*$" + } + }, + "required": [ + "clone_url" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + } }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "configurations", + "v3" + ], + "summary": "Delete a single configuration", + "x-openapi-router-controller": "cray.cfs.api.controllers.configurations", + "description": "Delete the given configuration. This will fail in any components are using the specified configuration.", + "operationId": "delete_configuration_v3", + "responses": { + "204": { + "description": "The resource was deleted." }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } + }, + "404": { + "description": "The resource was not found.", + "content": { + "application/problem+json": { + "schema": { + "description": "An error response for RFC 7807 problem details.", + "type": "object", + "properties": { + "type": { + "description": "Relative URI reference to the type of problem which includes human readable documentation.", + "type": "string", + "format": "uri", + "default": "about:blank" + }, + "title": { + "description": "Short, human-readable summary of the problem, should not change by occurrence.", + "type": "string" + }, + "status": { + "description": "HTTP status code", + "type": "integer", + "example": 400 + }, + "instance": { + "description": "A relative URI reference that identifies the specific occurrence of the problem", + "format": "uri", + "type": "string" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "parameters": [ - { - "name": "configuration_id", - "in": "path", - "description": "Name of the target configuration", - "required": true, - "schema": { - "type": "string" - } + }, + "parameters": [ + { + "name": "configuration_id", + "in": "path", + "description": "Name of the target configuration", + "required": true, + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 60 + } + } + ] } - ] } - } -} +} \ No newline at end of file diff --git a/cray/tests/test_modules/test_cfs.py b/cray/tests/test_modules/test_cfs.py index 3df1ef4..6385d5c 100644 --- a/cray/tests/test_modules/test_cfs.py +++ b/cray/tests/test_modules/test_cfs.py @@ -61,41 +61,58 @@ def test_cray_cfs_sessions_base(cli_runner, rest_mock): assert txt in result.output -def test_cray_cfs_session_delete(cli_runner, rest_mock): +def test_cray_cfs_v2_sessions_base(cli_runner, rest_mock): + """ Test cray cfs sessions base command """ + runner, cli, _ = cli_runner + result = runner.invoke(cli, ['cfs', 'v2', 'sessions']) + assert result.exit_code == 0 + + outputs = [ + "Commands:", + "create", + "delete", + "describe", + "list", + ] + for txt in outputs: + assert txt in result.output + + +def test_cray_cfs_v2_session_delete(cli_runner, rest_mock): """ Test cray cfs delete ... """ runner, cli, config = cli_runner - result = runner.invoke(cli, ['cfs', 'sessions', 'delete', 'foo']) + result = runner.invoke(cli, ['cfs', 'v2', 'sessions', 'delete', 'foo']) assert result.exit_code == 0 data = json.loads(result.output) assert data['method'] == 'DELETE' assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v2/sessions/foo' -def test_cray_cfs_session_list(cli_runner, rest_mock): +def test_cray_cfs_v2_session_list(cli_runner, rest_mock): """ Test cray cfs list """ runner, cli, config = cli_runner - result = runner.invoke(cli, ['cfs', 'sessions', 'list']) + result = runner.invoke(cli, ['cfs', 'v2', 'sessions', 'list']) assert result.exit_code == 0 data = json.loads(result.output) assert data['method'] == 'GET' assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v2/sessions' -def test_cray_cfs_session_describe(cli_runner, rest_mock): +def test_cray_cfs_v2_session_describe(cli_runner, rest_mock): """ Test cray cfs describe """ runner, cli, config = cli_runner - result = runner.invoke(cli, ['cfs', 'sessions', 'describe', 'foo']) + result = runner.invoke(cli, ['cfs', 'v2', 'sessions', 'describe', 'foo']) assert result.exit_code == 0 data = json.loads(result.output) assert data['method'] == 'GET' assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v2/sessions/foo' -def test_cray_cfs_session_create(cli_runner, rest_mock): +def test_cray_cfs_v2_session_create(cli_runner, rest_mock): """ Test cray cfs create ... happy path """ runner, cli, config = cli_runner result = runner.invoke( - cli, ['cfs', 'sessions', 'create', '--name', 'foo', + cli, ['cfs', 'v2', 'sessions', 'create', '--name', 'foo', '--configuration-name', 'bar'] ) assert result.exit_code == 0 @@ -109,11 +126,11 @@ def test_cray_cfs_session_create(cli_runner, rest_mock): } -def test_cray_cfs_session_create_full(cli_runner, rest_mock): +def test_cray_cfs_v2_session_create_full(cli_runner, rest_mock): """ Test cray cfs create ... happy path """ runner, cli, config = cli_runner result = runner.invoke( - cli, ['cfs', 'sessions', 'create', '--name', 'foo', + cli, ['cfs', 'v2', 'sessions', 'create', '--name', 'foo', '--configuration-name', 'bar', '--configuration-limit', 'baz', '--ansible-limit', 'Compute', @@ -146,12 +163,125 @@ def test_cray_cfs_session_create_full(cli_runner, rest_mock): } -def test_cray_cfs_session_create_missing_required(cli_runner, rest_mock): +def test_cray_cfs_v2_session_create_missing_required(cli_runner, rest_mock): + """ Test cray cfs create ... when a required parameter is missing """ + runner, cli, _ = cli_runner + result = runner.invoke( + cli, + ['cfs', 'v2', 'sessions', 'create', '--configuration-name', 'foo'] + ) + assert result.exit_code == 2 + assert '--name' in result.output + + +def test_cray_cfs_v3_sessions_base(cli_runner, rest_mock): + """ Test cray cfs sessions base command """ + runner, cli, _ = cli_runner + result = runner.invoke(cli, ['cfs', 'v3', 'sessions']) + assert result.exit_code == 0 + + outputs = [ + "Commands:", + "create", + "delete", + "describe", + "list", + ] + for txt in outputs: + assert txt in result.output + + +def test_cray_cfs_v3_session_delete(cli_runner, rest_mock): + """ Test cray cfs delete ... """ + runner, cli, config = cli_runner + result = runner.invoke(cli, ['cfs', 'v3', 'sessions', 'delete', 'foo']) + assert result.exit_code == 0 + data = json.loads(result.output) + assert data['method'] == 'DELETE' + assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v3/sessions/foo' + + +def test_cray_cfs_v3_session_list(cli_runner, rest_mock): + """ Test cray cfs list """ + runner, cli, config = cli_runner + result = runner.invoke(cli, ['cfs', 'v3', 'sessions', 'list']) + assert result.exit_code == 0 + data = json.loads(result.output) + assert data['method'] == 'GET' + assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v3/sessions' + + +def test_cray_cfs_v3_session_describe(cli_runner, rest_mock): + """ Test cray cfs describe """ + runner, cli, config = cli_runner + result = runner.invoke(cli, ['cfs', 'v3', 'sessions', 'describe', 'foo']) + assert result.exit_code == 0 + data = json.loads(result.output) + assert data['method'] == 'GET' + assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v3/sessions/foo' + + +def test_cray_cfs_v3_session_create(cli_runner, rest_mock): + """ Test cray cfs create ... happy path """ + runner, cli, config = cli_runner + result = runner.invoke( + cli, ['cfs', 'v3', 'sessions', 'create', '--name', 'foo', + '--configuration-name', 'bar'] + ) + assert result.exit_code == 0 + data = json.loads(result.output) + assert data['method'] == 'POST' + assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v3/sessions' + assert data['body'] == { + 'name': 'foo', + 'configuration_name': 'bar', + 'target': {'definition': 'dynamic', 'groups': [], 'image_map': []}, + } + + +def test_cray_cfs_v3_session_create_full(cli_runner, rest_mock): + """ Test cray cfs create ... happy path """ + runner, cli, config = cli_runner + result = runner.invoke( + cli, ['cfs', 'v3', 'sessions', 'create', '--name', 'foo', + '--configuration-name', 'bar', + '--configuration-limit', 'baz', + '--ansible-limit', 'Compute', + '--ansible-config', 'default-config', + '--ansible-verbosity', '1', + '--target-definition', 'spec', + '--target-group', 'foo', 'a, b, c', + '--target-group', 'bar', 'x,y,z', + '--target-image-map', 'foo', 'new'] + ) + assert result.exit_code == 0 + data = json.loads(result.output) + assert data['method'] == 'POST' + assert data['url'] == f'{config["default"]["hostname"]}/apis/cfs/v3/sessions' + assert data['body'] == { + 'name': 'foo', + 'configuration_name': 'bar', + 'configuration_limit': 'baz', + 'ansible_limit': 'Compute', + 'ansible_config': 'default-config', + 'ansible_verbosity': 1, + 'target': { + 'definition': 'spec', + 'groups': [ + {'name': 'foo', 'members': ['a', 'b', 'c']}, + {'name': 'bar', 'members': ['x', 'y', 'z']} + ], + 'image_map': [{'source_id': 'foo', 'result_name': 'new'}] + }, + } + + +def test_cray_cfs_v3_session_create_missing_required(cli_runner, rest_mock): """ Test cray cfs create ... when a required parameter is missing """ runner, cli, _ = cli_runner result = runner.invoke( cli, - ['cfs', 'sessions', 'create', '--configuration-name', 'foo'] + ['cfs', 'v3', 'sessions', 'create', '--configuration-name', 'foo'] ) assert result.exit_code == 2 assert '--name' in result.output