Web service API

How to use PageSeeder's Web service API

hosts

/hosts [POST]

com.pageseeder.host.CreateHost

Description

Creates a host.

Before you create a new host consider whether, creating a new host alias is more appropriate. To create an alias to existing host use the following service: /hosts/{hostname}/hostaliases [POST]

Parameters

NameDescriptionRequiredTypeDefault value
namethe name of the hostyesstring
externalWhether the host is externalnobooleanfalse
restart-emailWhether to restart the email server if requirednobooleantrue

name

The name of the host to create must be at least two characters long, at most 100 characters long, a valid host according to RFC 3986 - section 3.2.2 host , and match the following regular expression:

([a-z0-9]([a-z0-9-]*[a-z0-9])?\.?)+[a-z0-9]([a-z0-9-]*[a-z0-9])?

PageSeeder supports IPv4 addresses and regular names.

Note

The host name is not case-sensitive and it is not case-preserving: it will always be converted to lower case before being stored in the database.

restart-email

The purpose of this parameter is to prevent the email server from being restarted if  the emailDomain template property is set to pshosts.

When the emailDomain template property is set to pshosts,  the PageSeeder email server must be restarted in order to handle the new host; it will do so unless this parameter is set to "false ".

Permission

Only administrators can invoke this service.

Response

If successful, the created host is returned as a single <host> element wrapped in a <host-creation> element.

<host-creation>
   <host id="2" name="acme.com" external="false"/>
</host-creation>

Note

Since the host has only just been created, it will not include any alias.

Error handling

No specific errors expected for this generator.

Created on , last edited on