Create an application component
POST/applications/:applicationId/components
Creates a new component in the specified application.
Request
Path Parameters
Possible values: non-empty
Header Parameters
CodeNOW API Key
- application/vnd.codenow.v2+json
- ⚠️ application/vnd.codenow.v1+json
Body
required
true
: you must define spaceId and repositoryId of the existing repository in the requestfalse
: new repository will be created for the componenttrue
: you must define componentPath where the component will be hosted in the repositoryfalse
: the component will be hosted in the root of the repository- List available templates at
/templates/application_components
endpoint and choose the one desired. - Depending on the template, it may be necessary to attach required/optional properties in the request body. For example, a template property defined as:
- Assemble and send final request, for example:
- Any omitted optional parameters will be replaced with default values.
Human readable name of the component.
CodeNOW will generate an ID for the library based on this name.
Optional description of the component.
scm
object
required
Defines the repository in SCM.
Supported providers/actions can be obtained through the /scm/providers
endpoint.
Possible values: [CREATE
, LINK
]
Default value: CREATE
Action that will be performed on the SCM repository.
CREATE: New SCM repository will be created for the component.
LINK: The component will be linked to an existing SCM repository (unique ID of the repository will be required).
Possible values: non-empty
Instance ID of an existing SCM provider
Available providers and supported actions can be obtained through the /scm/providers
endpoint.
Possible values: non-empty
Type of an existing SCM provider
Available providers and supported actions can be obtained through the /scm/providers
endpoint.
Defines if the new component will be created in existing repository:
Defines if the new component will be share repository with other components:
Possible values: Value must match regular expression ^[a-zA-Z0-9\-_~/]*$
Define path in the repository where the component will be placed.
ID of an existing SCM spaces where repository will be hosted.
Available repositories can be obtained through the /scm/provider/{providerType}/{providerId}/spaces
endpoint.
ID of an existing SCM repository to which the component should be placed.
Available repositories can be obtained through the /scm/provider/{providerType}/{providerId}/spaces/{spaceId}/repos
endpoint.
template
object
required
Defines the template used for scaffolding the application component.
Example:
"properties": [
{
"name": "groupId",
"description": "Base Java package",
"type": "string",
"required": true
}
]
is mandatory and will be used like this:
"properties": {
"groupId": "com.example"
}
{
"name": "example-comp1",
"description": "example-comp1",
"scm": {
"action": "CREATE",
"providerId": "codenow",
"providerType": "codenow",
"existingRepository": false,
"monoRepository": false,
"spaceId": "codenow"
},
"template": {
"id": "java-maven-generic",
"version": "4.1.0",
"custom": false,
"properties": {
"groupId": "com.example"
}
}
}
Possible values: non-empty
An internal identifier of the scaffold selected for library creation.
It includes information about the selected language, build tool and framework, if specified.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
Possible values: non-empty
The desired version of the selected template.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
A boolean flag indicating whether the template is user-customized. If set to false, the template is provided by CodeNOW.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
properties
object
A map of properties ("key": "value") required for proper template configuration.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
Please use a newer version of the operation.
Body
required
- List available templates at
/templates/application_components
endpoint and choose the one desired. - Depending on the template, it may be necessary to attach required/optional properties in the request body. For example, a template property defined as:
- Assemble and send final request, for example:
- Any omitted optional parameters will be replaced with default values.
Human readable name of the component.
CodeNOW will generate an ID for the library based on this name.
Optional description of the component.
scm
object
required
Defines the repository in SCM.
Supported providers/actions can be obtained through the /scm/providers
endpoint.
Possible values: [CREATE
, LINK
]
Default value: CREATE
Action that will be performed on the SCM repository.
CREATE: New SCM repository will be created for the component.
LINK: The component will be linked to an existing SCM repository (unique ID of the repository will be required).
Instance ID of an existing SCM provider
Available providers and supported actions can be obtained through the /scm/providers
endpoint.
If in doubt use "action": "CREATE", "provider": "codenow"
ID of an existing SCM repository to which the component should be linked.
It is only required for the LINK
ActionType.
template
object
required
Defines the template used for scaffolding the application component.
Example:
"properties": [
{
"name": "groupId",
"description": "Base Java package",
"type": "string",
"required": true
}
]
is mandatory and will be used like this:
"properties": {
"groupId": "com.example"
}
{
"name": "example-comp1",
"description": "example-comp1",
"scm": {
"action": "CREATE",
"provider": "codenow"
},
"template": {
"id": "java-maven-generic",
"version": "4.1.0",
"properties": {
"groupId": "com.example"
}
}
}
Possible values: non-empty
An internal identifier of the scaffold selected for library creation.
It includes information about the selected language, build tool and framework, if specified.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
Possible values: non-empty
The desired version of the selected template.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
properties
object
A map of properties ("key": "value") required for proper template configuration.
Available templates can be obtained through the:
/templates/application_components
endpoint for application component or
/templates/libraries
endpoint for library
Responses
- 200
- 400
- 401
- 403
- 404
- 429
- 500
application-components-create 200 response
- application/vnd.codenow.v2+json
- ⚠️ application/vnd.codenow.v1+json
- Schema
- Example (from schema)
Schema
Unique application component ID.
Human readable name of the component.
Description of the component.
ID of the template used for scaffolding the application component.
Possible values: [CREATING
, READY
, FAILED
, DELETING
]
State of the application component.
CREATING - Application component is in the process of being created.
READY - Application component is ready to be used.
FAILED - Application component creation has failed.
DELETING - Application component is in the process of being deleted.
{
"id": "string",
"name": "string",
"description": "string",
"templateId": "string",
"state": "CREATING"
}
Please use a newer version of the operation.
- Schema
- Example (from schema)
Schema
Unique application component ID.
Human readable name of the component.
Description of the component.
ID of the template used for scaffolding the application component.
Possible values: [CREATING
, READY
, FAILED
, DELETING
]
State of the application component.
CREATING - Application component is in the process of being created.
READY - Application component is ready to be used.
FAILED - Application component creation has failed.
DELETING - Application component is in the process of being deleted.
{
"id": "string",
"name": "string",
"description": "string",
"templateId": "string",
"state": "CREATING"
}
The request was unacceptable, often due to missing a required parameter.
No valid API key provided.
The API key doesn't have permissions to perform the request.
Resource not found.
Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
Something went wrong on CodeNOW's end.