Skip to content

Admin API

The Admin API is available on port 17006.

Please see the Config Reference for all the supported configurations and descriptions.

config

Show

Return a JSON config Object with the current configuration.

http
GET /config HTTP/1.1

Example curl:

bash
curl http://IMAGIZER_HOSTNAME:17006/config

Create

Use POST to create a complete new config. Pass a JSON config Object.

DANGER

A POST will overwrite any existing configuration.

http
POST /config HTTP/1.1
Content-Type: application/json

{  
   "backend":"http://my.aws.bucket.s3.amazonaws.com",
   "backendTimeout":20,
   "backendConnectTimeout":3
}

Example curl:

bash
curl -X POST \
 -d '{  
        "backend":"http://my.aws.bucket.s3.amazonaws.com",
        "backendTimeout":20,
        "backendConnectTimeout":3
     }' \
http://IMAGIZER_HOSTNAME:17006/config

Update

Use PATCH to make partial changes to the configuration. Pass a JSON config Object.

WARNING

Changes may not be seen immediately. You may have to reboot the instance or clear the cache.

http
PATCH /config HTTP/1.1
Content-Type: application/json

{  
   "backend":"http://my.aws.bucket.s3.amazonaws.com"
}

Example curl:

bash
curl -X PATCH \
 -d '{  
        "backend":"http://my.aws.bucket.s3.amazonaws.com"
     }' \
http://IMAGIZER_HOSTNAME:17006/config

Debug

System and debugging information

Show the temp disk report

http
GET /debug/tmp HTTP/1.1

List open files

http
GET /debug/lsof HTTP/1.1

Show memory process report

http
GET /debug/memory HTTP/1.1

Show services report

http
GET /debug/services HTTP/1.1

Show specific service report

http
GET /debug/services/{service} HTTP/1.1

Debugging Report

If you are experiencing issues with your Imagizer instance, you may be asked to provide a debugging report to our support team.

v14.1-86.X and above

Generate a debugging report

shell
curl -X POST http://IMAGIZER_HOST:17006/debug/generateReport

The debug report will be available for download by visiting http://IMAGIZER_HOST:17006/debug/reports.

v14.0-85.X and below

Download and run the debugging script to generate a report.

shell
wget https://docs.imagizer.com/imagizer-debug-report.sh
bash imagizer-debug-report.sh $IMAGIZER_HOST # replace with your Imagizer hostname/IP
Click to see the script
shell
#!/bin/bash

if [ -z "$1" ]
	then
		echo "No Imagizer host/ip supplied"
		echo "Usage: bash imagizer-debug-report.sh <imagizer-host>"
		exit 1
fi

IMAGIZER_HOST="$1"
TIMESTAMP=$(date +%s)

echo Create directory
mkdir "$IMAGIZER_HOST-$TIMESTAMP"

(
  cd "$IMAGIZER_HOST-$TIMESTAMP" || exit

	echo Downloading version
	curl -s "http://$IMAGIZER_HOST:17006/version" -o "$IMAGIZER_HOST-$TIMESTAMP-version.txt"

	echo Downloading health
	curl -s "http://$IMAGIZER_HOST:17006/health" -o "$IMAGIZER_HOST-$TIMESTAMP-health.txt"

	echo Downloading config
	curl -s "http://$IMAGIZER_HOST:17006/config" -o "$IMAGIZER_HOST-$TIMESTAMP-config.json"

	echo Downloading stats snapshot
	curl -s "http://$IMAGIZER_HOST:17006/stats" -o "$IMAGIZER_HOST-$TIMESTAMP-stats.json"

	echo Downloading Cluster report
	curl -s "http://$IMAGIZER_HOST:17006/cluster" -o "$IMAGIZER_HOST-$TIMESTAMP-cluster.json"

	echo Downloading logs
	curl -s "http://$IMAGIZER_HOST:17006/logs/" | grep -E -o "[0-9a-z.-]*(gz|log)" | uniq | xargs -I{} curl -s http://$IMAGIZER_HOST:17006/logs/{} -o {}

	echo Downloading debugging reports
	curl -s "http://$IMAGIZER_HOST:17006/debug/tmp" -o "$IMAGIZER_HOST-$TIMESTAMP-tmp.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/lsof" -o "$IMAGIZER_HOST-$TIMESTAMP-lsof.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/memory" -o "$IMAGIZER_HOST-$TIMESTAMP-memory.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services" -o "$IMAGIZER_HOST-$TIMESTAMP-services.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/php-fpm.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-php-fpm.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/varnish.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-varnish.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/nginx.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-nginx.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/haproxy.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-haproxy.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/imagizer-app-schedule.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-imagizer-app-schedule.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/redis-image-cache.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-redis-image-cache.txt"
	curl -s "http://$IMAGIZER_HOST:17006/debug/services/imagizer-cloud-stats-collector.service" -o "$IMAGIZER_HOST-$TIMESTAMP-services-imagizer-cloud-stats-collector.txt"
)

echo Downloading tarball
tar -czvf "$IMAGIZER_HOST.$TIMESTAMP.tar.gz" "$IMAGIZER_HOST-$TIMESTAMP"

echo Done. please share the file "$IMAGIZER_HOST.$TIMESTAMP.tar.gz" with Imagizer support.

Stats

Return a list of current stats.

See the Stats Reference for detailed information on each stat.

Show

http
GET /stats HTTP/1.1

Return the current stats.

shell
curl -X GET http://IMAGIZER_HOST:17006/stats

Logs

http
GET /logs HTTP/1.1

TIP

You must enable logs first before viewing.

View application, web server, and system logs.

Metrics

See the Prometheus config documentation for more information.

TIP

Prometheus metrics are also available on port 9100.

http
GET /metrics HTTP/1.1

cache

When using clustered Imagizer instances, purge requests will be forwarded to all nodes. Make sure the cluster nodes have access to each other's cache purging port.

TIP

Port 17011 may alternatively be used for cache purging.

Purge

Purge an image from the Imagizer cache.

http
DELETE ${IMAGE_URL} HTTP/1.1

Examples

Purge /image.jpg from the cache.

shell
curl -X DELETE http://$IMAGIZER_HOST:17006/image.jpg

WARNING

With separateHostCache set to true, the hostname will influence the cache key. Use the same hostname for purging, or utilize the hostname parameter to override it when necessary.

Purge /image.jpg from the cache using the hostname override parameter.

shell
curl -X DELETE -d hostname=$IMAGIZER_HOST http://$IMAGIZER_INTERNAL_HOST:17006/image.jpg

Purge All

Purge all images from the Imagizer cache.

http
DELETE / HTTP/1.1

Purge all images.

shell
curl -X DELETE http://IMAGIZER_HOST:17006/

Network

Show

This endpoint retrieves the current network configuration

http
GET /network HTTP/1.1
Content-Type: application/json
shell
curl /network

The above command returns JSON structured like this:

json
{  
   "static":false,
   "ip":"192.168.1.100",
   "netmask":"255.255.255.0",
   "gateway":"192.168.1.1",
   "dnsServers":[  
      "192.168.1.1"
   ]
}
PropertyDescription
staticWhether or not the instance is using a static IP.
ipThe current IP of the instance.
netmaskThe current netmask of the instance.
gatewayThe current gateway address of the instance.
dnsServersA list of DNS servers the instance is using.

Updates

Minor updates may be applied directly on your Imagizer instance through the /updates endpoint.

TIP

Reboot the instance after applying the update to ensure all changes take effect.

View Available Updates

List available updates (requires v14+)

bash
curl http://IMAGIZER_HOST:17006/updates/available

The above command returns JSON structured like this:

json
[
    {
        "version": "14.0-83.3",
        "url": "https://updates.imagizer.com/imagizer/imagizer-14.0-83.3.patch"
    },
    {
        "version": "14.0-81.2",
        "url": "https://updates.imagizer.com/imagizer/imagizer-14.0-83.2.patch"
    }
]

Apply Update

Apply the latest update (requires v14+)

bash
curl -d "version=latest" \
http://IMAGIZER_HOST:17006/updates

Apply a specific version (requires v14+)

bash
curl -d "version=14.0-83.2" \
http://IMAGIZER_HOST:17006/updates

Apply an update by URL (requires v14+)

bash
curl -d "url=https://updates.imagizer.com/imagizer/imagizer-14.0-83.1.patch" \
http://IMAGIZER_HOST:17006/updates

Apply an update by file

bash
curl -F "file=@imagizer-14.0-83.1.patch" \
http://IMAGIZER_HOST:17006/updates

Monitor Updates

Updates take a few minutes and may be monitored with a GET request.

bash
curl http://IMAGIZER_HOST:17006/updates

The above command returns JSON structured like this:

json
[
    {
       "filename": "patch2017011915521484949961",
       "status": [
          "Update has been applied"
       ]
    }
]