Create a new component

Request

PUT https://{hostname}:{port}
  /cli/component/create
This command takes a JSON request string or file. Use the following template for the request:
{
  "cleanupCountToKeep": "Number of most recent versions to 
  keep; omit this parameter to inherit the system settings 
  (Optional)",
  "cleanupDaysToKeep": "Number of days to keep versions; 
  omit this parameter to inherit the system settings 
  (Optional)",
  "defaultVersionType": "The default type to create 
  versions with; valid values are FULL and INCREMENTAL",
  "description": "Description",
  "importAutomatically": "Specify true to import new 
  versions automatically",
  "name": "Component name or ID",
  "properties": {"Property name": "Property value"},
  "sourceConfigPlugin": "The name of the source 
  configuration plug-in to use",
  "templateId": "ID of the template to use (Optional)",
  "templateName": "Name of a template to use; this 
  parameter is ignored if  templateId is specified 
  (Optional)",
  "templateVersion": "Version number of the specified 
  template (Optional)",
  "useVfs": "Boolean"
}

Example JSON request

{
  "name": "My new component",
  "description": "New component for command example",
  "importAutomatically": false,
  "useVfs": true,
  "sourceConfigPlugin": "File System",
  "defaultVersionType": "FULL",
  "properties": {
    "Base Path": "/opt/newcomponent"
  }
}

Example response

{
  "id": "e84c7947-fad1-4399-8eb8-0d0d354b9e2b",
  "name": "My new component",
  "description": "New component for command example",
  "created": 1391456765556,
  "importAutomatically": false,
  "useVfs": true,
  "active": true,
  "deleted": false,
  "defaultVersionType": "FULL",
  "cleanupDaysToKeep": 0,
  "cleanupCountToKeep": 0,
  "tags": [
  ],
  "user": "admin"
}

Related CLI command: createComponent.


Feedback