Create a host
Creates a host using the Host Factory and returns a JSON description of it. If the host already exists, the API key of that host is rotated.
Requires a Host Factory token which can be created using the Create tokens API. In practice, this token is usually provided automatically as part of Conjur integration with your host provisioning infrastructure.
If the Host Factory token was created with a CIDR restriction, you must make this API request from a allowlisted address.
URI
|
Example with curl
Supposing that you have a Host Factory token and want to create a new host
called “brand-new-host”:
|
Request Headers
A Host Factory token must be provided as part of an HTTP Authorization
header. For example:
Authorization: Token token=2c0vfj61pmah3efbgpcz2x9vzcy1ycskfkyqy0kgk1fv014880f4
Request Body Parameters
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
id |
String |
Yes |
Identifier of the host to be created. It will be created within the account of the Host Factory. Example: |
annotations |
Object |
No |
Annotations to apply to the new host Example: |
Response
Code |
Description |
---|---|
201 |
A host was created, its definition is returned as a JSON document in the response body |
401 |
The token was invalid, expired, or the CIDR restriction was not satisfied |
422 |
The request body was empty or a parameter was not formatted correctly |
Example URI
|
Response 201
Headers
|
Body
|