Crafter Deployer (4.7.1)

Download OpenAPI specification:

E-mail: info@craftercms.org License: GPL 3.0

Crafter Deployer API.
Target management operations require the X-Crafter-Management-Token header. The token query parameter is not accepted for those operations. Monitoring operations still authenticate with the token query parameter.

target

Target management operations

Create a Crafter Deployer target

Module: Deployer
Target creation is based on templates. The deployer comes with two out of the box: remote and local. The remote template creates targets that pull changes from a remote Git repository, making it ideal to create targets for delivery environments. The local template instead generates targets that use a local Git repo and the last processed commit to infer the changes, without executing a pull, so it’s used mostly to create targets for authoring environments.

If a target already exists and replace is true, then the new target will replace the existing one. If replace is false and the target exists, a 409 is returned.

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Request Body schema: application/json
required

Create target request body

env
required
string

The target’s environment (e.g. dev).

site_name
required
string

The target’s project/site name (e.g. my-editorial).

replace
boolean

Replace the existing target.

template_name
string

The template to use for configuration generation. Out-of-the-box remote and local are provided. If not specified, remote will be used.

disable_deploy_cron
boolean

Disables the cron job that runs deployments every certain amount of time.

repo_url
required
string

Depends on the template. If remote is being used, it specifies the URL of the remote repo to pull from (e.g. ssh://…). If instead the template is local, repo_url is the filesystem path of the local repo (e.g. /opt/..).

repo_branch
string

Only use with remote template. The branch name of the remote Git repo to pull from. If not specified, the branch will be whatever branch is the current one in the remote repo.

repo_username
string

Only use with remote template. The username of the remote Git repo.

repo_password
string

Only use with remote template. The password of the remote Git repo.

ssh_private_key_path
string

Only use with remote template. The path for the private key used for the remote Git repo.

ssh_private_key_passphrase
string

Only use with remote template. The passphrase for the private key for the remote Git repo (only if the key is passphrase-protected).

engine_url
string

Base URL of Engine, used to make API calls like clear cache and rebuild context. If not specified, the default is http://localhost:8080.

notification_addresses
string

The email addresses that should receive deployment notifications.

Responses

Request samples

Content type
application/json
Example

Module: Deployer

{
  • "env": "preview",
  • "site_name": "my-editorial",
  • "replace": true,
  • "disable_deploy_cron": true,
  • "template_name": "local",
  • "repo_url": "/opt/crafter/data/repos/sites/my-editorial/sandbox",
  • "engine_url": "http://localhost:8080"
}

Response samples

Content type
application/json
{
  • "message": "OK"
}

Get a Crafter Deployer target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "env": "dev",
  • "siteName": "editorial",
  • "id": "editorial-dev",
  • "load_date": "2023-01-26T10:00:01.234-05:00",
  • "status": "INIT_COMPLETED"
}

Get all Crafter Deployer targets.

Module: Deployer

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Delete a Crafter Deployer target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "message": "Invalid request"
}

Delete a Crafter Deployer target if it exists.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "message": "Invalid request"
}

Deploy a Crafter Deployer target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Request Body schema: application/json
reprocess_all_files
boolean

If all files in all the target repos should be reprocessed.

from_commit_id
string

The id of the commit to start processing changes

Available since version 4.0.0

deployment_mode
string

The deployment mode to execute. Possible values:
   PUBLISH: All processors will run
   SEARCH_INDEX: Only the indexing processor will run

Available since version 4.0.0

Responses

Request samples

Content type
application/json
{
  • "reprocess_all_files": true,
  • "from_commit_id": "string",
  • "deployment_mode": "string"
}

Response samples

Content type
application/json
{
  • "message": "OK"
}

Deploy all Crafter Deployer targets.

Module: Deployer

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Request Body schema: application/json
reprocess_all_files
boolean

If all files in all the target repos should be reprocessed.

deployment_mode
string

The deployment mode to execute. Possible values:
   PUBLISH: All processors will run
   SEARCH_INDEX: Only the indexing processor will run

Available since version 4.0.0

Responses

Request samples

Content type
application/json
{
  • "reprocess_all_files": true,
  • "deployment_mode": "string"
}

Response samples

Content type
application/json
{
  • "message": "OK"
}

Get the pending deployments for a target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Get the current deployment for a target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "mode": "PUBLISH",
  • "status": null,
  • "running": true,
  • "duration": null,
  • "start": "2025-03-11T17:07:00.006221-04:00",
  • "end": null,
  • "target": {
    },
  • "changeSet": {
    },
  • "processorExecutions": [
    ]
}

Get the current and pending deployments for a target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Clear git lock of a Crafter Deployer target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "message": "Invalid request"
}

Recreate the underlying search index for a Crafter Deployer target.

Module: Deployer

path Parameters
env
required
string
Example: env,dev

The target’s environment (e.g. dev).

site_name
required
string
Example: site_name,editorial

The target’s project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Responses

Response samples

Content type
application/json
{
  • "message": "OK"
}

Duplicate a target

Module: Deployer

path Parameters
env
required
string
Example: dev

The target’s environment (e.g. dev).

source_site_name
required
string
Example: editorial

The source project/site name (e.g. editorial).

header Parameters
X-Crafter-Management-Token
required
string
Example: aValidTokenValue

Management token for Deployer target operations. Send the configured deployer.main.management.authorizationToken value. The token query parameter is not accepted. A request that sends only the query parameter is unauthorized.

Request Body schema: application/json
required

Duplicate target's request body

env
required
string

The target’s environment (e.g. dev).

site_name
required
string

The target’s project/site name (e.g. my-editorial).

replace
boolean

Replace the existing target.

template_name
string

The template to use for configuration generation. Out-of-the-box remote and local are provided. If not specified, remote will be used.

disable_deploy_cron
boolean

Disables the cron job that runs deployments every certain amount of time.

repo_url
required
string

Depends on the template. If remote is being used, it specifies the URL of the remote repo to pull from (e.g. ssh://…). If instead the template is local, repo_url is the filesystem path of the local repo (e.g. /opt/..).

repo_branch
string

Only use with remote template. The branch name of the remote Git repo to pull from. If not specified, the branch will be whatever branch is the current one in the remote repo.

repo_username
string

Only use with remote template. The username of the remote Git repo.

repo_password
string

Only use with remote template. The password of the remote Git repo.

ssh_private_key_path
string

Only use with remote template. The path for the private key used for the remote Git repo.

ssh_private_key_passphrase
string

Only use with remote template. The passphrase for the private key for the remote Git repo (only if the key is passphrase-protected).

engine_url
string

Base URL of Engine, used to make API calls like clear cache and rebuild context. If not specified, the default is http://localhost:8080.

notification_addresses
string

The email addresses that should receive deployment notifications.

object

Responses

Request samples

Content type
application/json
{
  • "env": "string",
  • "site_name": "string",
  • "replace": true,
  • "template_name": "string",
  • "disable_deploy_cron": true,
  • "repo_url": "string",
  • "repo_branch": "string",
  • "repo_username": "string",
  • "repo_password": "string",
  • "ssh_private_key_path": "string",
  • "ssh_private_key_passphrase": "string",
  • "engine_url": "string",
  • "notification_addresses": "string",
  • "source": {
    }
}

Response samples

Content type
application/json
{
  • "message": "OK"
}

monitoring

Monitoring operations

Get Crafter Deployer's version details.

Module: Deployer

query Parameters
token
required
string
Example: token=aValidTokenValue

The authorization token

Responses

Response samples

Content type
application/json
{
  • "packageName": "Crafter Deployer",
  • "packageVersion": "4.1.0-SNAPSHOT",
  • "packageBuild": "f33f1804c95dd0df4902c9732203841d22022459",
  • "packageBuildDate": "2023-04-17T21:28:40.642Z"
}

Get Crafter Deployer's system information details.

Module: Deployer

query Parameters
token
required
string
Example: token=aValidTokenValue

The authorization token

Responses

Response samples

Content type
application/json
{
  • "packageName": "Crafter Deployer",
  • "packageVersion": "4.1.0-SNAPSHOT",
  • "packageBuild": "f33f1804c95dd0df4902c9732203841d22022459",
  • "packageBuildDate": "2023-04-17T21:28:40.642Z",
  • "osName": "Mac OS X",
  • "osVersion": "13.2.1",
  • "osArch": "x86_64",
  • "javaVersion": 17,
  • "javaVendor": "Oracle Corporation",
  • "javaVm": "OpenJDK 64-Bit Server VM"
}

Get Crafter Deployer's status details.

Module: Deployer

query Parameters
token
required
string
Example: token=aValidTokenValue

The authorization token

Responses

Response samples

Content type
application/json
{
  • "StatusInfo": {
    }
}

Get Crafter Deployer's memory details.

Module: Deployer

query Parameters
token
required
string
Example: token=aValidTokenValue

The authorization token

Responses

Response samples

Content type
application/json
{
  • "MemoryInfo": {
    }
}