Create a container
POST/containers
The operation allows you to create a new container. A container constitutes a collection of pre-written and reusable code components, functions, and modules that enhance software development efficiency.
Request
Header Parameters
CodeNOW API Key
- 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 container will be hosted in the repositoryfalse: the container will be hosted in the root of the repository
Possible values: >= 3 characters and <= 170 characters
Human readable name of the container.
CodeNOW will generate an ID for the container based on this name.
The detailed textual description of the container. Allows users to add additional context, notes, or any relevant information about the purpose, usage, or characteristics of the container.
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 container will be created in existing repository:
Defines if the new container 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 container 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 container should be placed.
Available repositories can be obtained through the /scm/provider/{providerType}/{providerId}/spaces/{spaceId}/repos endpoint.
Responses
- 200
- 400
- 401
- 403
- 404
- 429
- 500
Container detail
- application/vnd.codenow.v1+json
- Schema
- Example (from schema)
Schema
The unique identifier of the container. Based on the user-defined container name.
The user-friendly name or label for the container. It allows users to provide a clear and descriptive name that helps in identifying and distinguishing different containers easily. The field accepts free text with alphanumeric and special characters.
The detailed textual description of the container. Allows users to add additional context, notes, or any relevant information about the purpose, usage, or characteristics of the container.
An internal identifier of the scaffold selected for container creation. It includes information about the selected language, build tool and framework, if specified.
Possible values: [CREATING, READY, FAILED, DELETING]
State of the container
CREATING - Container is being created
READY - Container is ready
FAILED - Container creation failed
DELETING - Container is being deleted
{
"id": "string",
"displayName": "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.