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
Liste des domaines

GET /api/subnets/:subnet_id/domains
Liste des domaines par sous-réseau

GET /api/locations/:location_id/domains
Liste des domaines par emplacement

GET /api/organizations/:organization_id/domains
Liste des domaines par organisation

Exemples

GET /api/domains
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "fullname": "example577.com",
      "created_at": "2019-09-11 14:41:10 UTC",
      "updated_at": "2019-09-11 14:41:10 UTC",
      "id": 759776770,
      "name": "example577.com",
      "dns_id": null,
      "dns": null
    }
  ]
}

Paramètres

Nom du paramètre Description
subnet_id
optionel

ID du sous-réseau

Validations:

  • Must be a String

location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

search
optionel

filtrer les résultats

Validations:

  • Must be a String

order
optionel

Champ et sens de tri, ex: ‘id DESC’

Validations:

  • Must be a String

page
optionel

Numéro de la page, commençant par 1

Validations:

  • Must be a number.

per_page
optionel

Nombre de résultats par page à renvoyer

Validations:

  • Must be a number.

Rechercher les champs

Nom du champ Type Valeurs possibles
fullname string
location string
location_id integer
name string
organization string
organization_id integer
params text

GET /api/domains/:id
Afficher un domaine

Exemples

GET /api/domains/22495316-mydomain-net
200
{
  "fullname": null,
  "created_at": "2019-09-11 14:45:07 UTC",
  "updated_at": "2019-09-11 14:45:07 UTC",
  "id": 22495316,
  "name": "mydomain.net",
  "dns_id": 113629430,
  "dns": {
    "name": "DNS Proxy",
    "id": 113629430,
    "url": "http://else.where:45671"
  },
  "subnets": [
    {
      "id": 980190962,
      "name": "one",
      "description": null,
      "network_address": "2.3.4.0/24"
    }
  ],
  "interfaces": [],
  "parameters": [
    {
      "priority": null,
      "created_at": "2019-09-11 14:45:07 UTC",
      "updated_at": "2019-09-11 14:45:07 UTC",
      "id": 665394701,
      "name": "parameter",
      "parameter_type": null,
      "value": "value1"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

ID numérique ou nom de domaine

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
optionel

Afficher les valeurs de paramètre masquées

Validations:

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


POST /api/domains
Créer un domaine

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

Exemples

POST /api/domains
{
  "organization_id": null,
  "domain": {
    "name": "example686.com"
  }
}
201
{
  "fullname": null,
  "created_at": "2019-09-11 14:45:08 UTC",
  "updated_at": "2019-09-11 14:45:08 UTC",
  "id": 759776766,
  "name": "example686.com",
  "dns_id": null,
  "dns": null,
  "subnets": [],
  "interfaces": [],
  "parameters": [],
  "locations": [],
  "organizations": []
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

domain
requis

Validations:

  • Must be a Hash

domain[name]
requis

Le nom DNS complet

Validations:

  • Must be a String

domain[fullname]
optionel , nil autorisé

Description du domaine

Validations:

  • Must be a String

domain[dns_id]
optionel , nil autorisé

ID proxy DNS à utiliser dans ce domaine

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
optionel , nil autorisé

Tableau de paramètres (nom, valeur)

Validations:

  • Must be an array of any type

domain[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

domain[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


PUT /api/domains/:id
Mise à jour d'un domaine

Exemples

PUT /api/domains/22495316-mydomain-net
{
  "domain": {
    "name": "domain.new"
  }
}
200
{
  "fullname": null,
  "created_at": "2019-09-11 14:45:07 UTC",
  "updated_at": "2019-09-11 14:45:08 UTC",
  "id": 22495316,
  "name": "domain.new",
  "dns_id": 113629430,
  "dns": {
    "name": "DNS Proxy",
    "id": 113629430,
    "url": "http://else.where:45671"
  },
  "subnets": [
    {
      "id": 980190962,
      "name": "one",
      "description": null,
      "network_address": "2.3.4.0/24"
    }
  ],
  "interfaces": [],
  "parameters": [
    {
      "priority": null,
      "created_at": "2019-09-11 14:45:07 UTC",
      "updated_at": "2019-09-11 14:45:07 UTC",
      "id": 665394701,
      "name": "parameter",
      "parameter_type": null,
      "value": "value1"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

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
requis

Validations:

  • Must be a Hash

domain[name]
optionel

Le nom DNS complet

Validations:

  • Must be a String

domain[fullname]
optionel , nil autorisé

Description du domaine

Validations:

  • Must be a String

domain[dns_id]
optionel , nil autorisé

ID proxy DNS à utiliser dans ce domaine

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
optionel , nil autorisé

Tableau de paramètres (nom, valeur)

Validations:

  • Must be an array of any type

domain[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

domain[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


DELETE /api/domains/:id
Supprimer un domaine

Exemples

DELETE /api/domains/22495316-mydomain-net
{
  "domain": {}
}
200
{
  "id": 22495316,
  "name": "mydomain.net",
  "fullname": null,
  "created_at": "2019-09-11T14:45:07.866Z",
  "updated_at": "2019-09-11T14:45:07.866Z",
  "dns_id": 113629430
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

Validations:

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