Foreman considers a domain and a DNS zone as the same thing. That is, if you are planning to manage a site where all the machines are of the form hostname.somewhere.com then the domain is somewhere.com. This allows Foreman to associate a puppet variable with a domain/site and automatically append this variable to all external node requests made by machines at that site.


GET /api/domains
Elenco dei domini

GET /api/subnets/:subnet_id/domains
Elenco di domini per sottorete

GET /api/locations/:location_id/domains
Elenco di domini per posizione

GET /api/organizations/:organization_id/domains
Elenco di domini per organizzazione

Esempi

GET /api/locations/447626442/organizations/447626440/domains
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "fullname": "example235.com",
      "created_at": "2019-11-07 08:37:31 UTC",
      "updated_at": "2019-11-07 08:37:31 UTC",
      "id": 759776772,
      "name": "example235.com",
      "dns_id": null,
      "dns": null
    }
  ]
}

Parametri

Nome parametro Descrizione
subnet_id
opzionale

ID della sottorete

Validations:

  • Must be a String

location_id
opzionale

Scopo per posizioni

Validations:

  • Must be a Integer

organization_id
opzionale

Scopo per organizzazioni

Validations:

  • Must be a Integer

search
opzionale

filtra i risultati

Validations:

  • Must be a String

order
opzionale

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
opzionale

Numero pagina, iniziando da 1

Validations:

  • Must be a number.

per_page
opzionale

Numero di risultati per pagina da ritornare

Validations:

  • Must be a number.

Search fields

Field name Tipo Possible values
fullname string
location string
location_id integer
name string
organization string
organization_id integer
params text

GET /api/domains/:id
Mostra un dominio

Esempi

GET /api/domains/759776768-example929-com
200
{
  "fullname": "example929.com",
  "created_at": "2019-11-07 08:53:46 UTC",
  "updated_at": "2019-11-07 08:53:46 UTC",
  "id": 759776768,
  "name": "example929.com",
  "dns_id": null,
  "dns": null,
  "subnets": [],
  "interfaces": [],
  "parameters": [
    {
      "priority": 30,
      "created_at": "2019-11-07 08:53:46 UTC",
      "updated_at": "2019-11-07 08:53:46 UTC",
      "id": 767575243,
      "name": "parameter323",
      "parameter_type": "string",
      "value": "parameter value 345"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

id
richiesto

ID numerico o nome del dominio

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

show_hidden_parameters
opzionale

Display hidden parameter values

Validations:

  • Must be one of: true, false, 1, 0.


POST /api/domains
Crea un dominio

The fullname field is used for human readability in reports and other pages that refer to domains, and also available as an external node parameter

Esempi

POST /api/domains
{
  "organization_id": 447626448,
  "domain": {
    "name": "example243.com",
    "organization_ids": [
      447626448
    ],
    "location_ids": [
      447626450
    ]
  }
}
201
{
  "fullname": null,
  "created_at": "2019-11-07 08:37:32 UTC",
  "updated_at": "2019-11-07 08:37:32 UTC",
  "id": 759776780,
  "name": "example243.com",
  "dns_id": null,
  "dns": null,
  "subnets": [],
  "interfaces": [],
  "parameters": [],
  "locations": [
    {
      "id": 447626450,
      "name": "loc67",
      "title": "loc67",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626448,
      "name": "org79",
      "title": "org79",
      "description": null
    }
  ]
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

domain
richiesto

Validations:

  • Must be a Hash

domain[name]
richiesto

Il nome del dominio DNS completo

Validations:

  • Must be a String

domain[fullname]
opzionale , consentito nil

Descrizione del dominio

Validations:

  • Must be a String

domain[dns_id]
opzionale , consentito nil

DNS proxy ID to use within this domain

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
opzionale , consentito nil

Insieme di parametri (nome, valore)

Validations:

  • Must be an array of any type

domain[location_ids]
opzionale , consentito nil

SOSTITUIRE le posizioni con gli id dati

Validations:

  • Must be an array of any type

domain[organization_ids]
opzionale , consentito nil

SOSTITUIRE le organizzazioni con gli id dati

Validations:

  • Must be an array of any type


PUT /api/domains/:id
Aggiorna un dominio

Esempi

PUT /api/domains/759776766
{
  "domain": {
    "domain_parameters_attributes": [
      {
        "name": "foo",
        "value": "new_value"
      }
    ]
  }
}
200
{
  "fullname": "example927.com",
  "created_at": "2019-11-07 08:53:46 UTC",
  "updated_at": "2019-11-07 08:53:46 UTC",
  "id": 759776766,
  "name": "example927.com",
  "dns_id": null,
  "dns": null,
  "subnets": [],
  "interfaces": [],
  "parameters": [
    {
      "priority": 30,
      "created_at": "2019-11-07 08:53:46 UTC",
      "updated_at": "2019-11-07 08:53:46 UTC",
      "id": 767575241,
      "name": "foo",
      "parameter_type": "string",
      "value": "new_value"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

id
richiesto

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

domain
richiesto

Validations:

  • Must be a Hash

domain[name]
opzionale

Il nome del dominio DNS completo

Validations:

  • Must be a String

domain[fullname]
opzionale , consentito nil

Descrizione del dominio

Validations:

  • Must be a String

domain[dns_id]
opzionale , consentito nil

DNS proxy ID to use within this domain

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
opzionale , consentito nil

Insieme di parametri (nome, valore)

Validations:

  • Must be an array of any type

domain[location_ids]
opzionale , consentito nil

SOSTITUIRE le posizioni con gli id dati

Validations:

  • Must be an array of any type

domain[organization_ids]
opzionale , consentito nil

SOSTITUIRE le organizzazioni con gli id dati

Validations:

  • Must be an array of any type


DELETE /api/domains/:id
Cancella un dominio

Esempi

DELETE /api/domains/22495316-mydomain-net
{
  "domain": {}
}
200
{
  "id": 22495316,
  "name": "mydomain.net",
  "fullname": null,
  "created_at": "2019-11-07T08:53:42.031Z",
  "updated_at": "2019-11-07T08:53:42.031Z",
  "dns_id": 113629430
}

Parametri

Nome parametro Descrizione
location_id
opzionale

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opzionale

Set the current organization context for the request

Validations:

  • Must be a Integer

id
richiesto

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.