GET /api/organizations
List all organizations

Examples

GET /api/organizations
200
{
  "total": 2,
  "subtotal": 2,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "ancestry": null,
      "parent_id": null,
      "parent_name": null,
      "created_at": "2022-09-06 15:12:24 UTC",
      "updated_at": "2022-09-06 15:12:24 UTC",
      "id": 447626445,
      "name": "org472",
      "title": "org472",
      "description": null
    },
    {
      "ancestry": null,
      "parent_id": null,
      "parent_name": null,
      "created_at": "2022-09-06 15:12:24 UTC",
      "updated_at": "2022-09-06 15:12:24 UTC",
      "id": 447626448,
      "name": "org473",
      "title": "org473",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.

Search fields

Field name Type Possible values
description text
id integer
name string
organization_id integer
title string

GET /api/organizations/:id
Show an organization

Examples

GET /api/organizations/447626442
200
{
  "select_all_types": [],
  "description": null,
  "created_at": "2022-09-06 14:36:51 UTC",
  "updated_at": "2022-09-06 14:36:51 UTC",
  "ancestry": null,
  "parent_id": null,
  "parent_name": null,
  "id": 447626442,
  "name": "org91",
  "title": "org91",
  "users": [],
  "smart_proxies": [],
  "subnets": [],
  "compute_resources": [],
  "media": [],
  "ptables": [],
  "provisioning_templates": [],
  "domains": [],
  "realms": [],
  "hostgroups": [],
  "locations": [],
  "hosts_count": 0,
  "parameters": [
    {
      "priority": 10,
      "created_at": "2022-09-06 14:36:51 UTC",
      "updated_at": "2022-09-06 14:36:51 UTC",
      "id": 767575245,
      "name": "foo",
      "parameter_type": "string",
      "value": "bar"
    }
  ],
  "deprecations": {
    "environments": "Environments got deprecated from this endpoint."
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

show_hidden_parameters
optional

Display hidden parameter values

Validations:

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

id
required

Validations:

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


POST /api/organizations
Create an organization

Examples

POST /api/organizations
{
  "organization": {
    "name": "org1"
  }
}
403
{
  "error": {
    "message": "Access denied",
    "details": "Missing one of the required permissions: create_organizations",
    "missing_permissions": [
      "create_organizations"
    ]
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

organization
required

Validations:

  • Must be a Hash

organization[name]
required

Validations:

  • Must be a String

organization[description]
optional , nil allowed

Validations:

  • Must be a String

organization[user_ids]
optional , nil allowed

User IDs

Validations:

  • Must be an array of any type

organization[smart_proxy_ids]
optional , nil allowed

Smart proxy IDs

Validations:

  • Must be an array of any type

organization[compute_resource_ids]
optional , nil allowed

Compute resource IDs

Validations:

  • Must be an array of any type

organization[medium_ids]
optional , nil allowed

Medium IDs

Validations:

  • Must be an array of any type

organization[ptable_ids]
optional , nil allowed

Partition template IDs

Validations:

  • Must be an array of any type

organization[provisioning_template_ids]
optional , nil allowed

Provisioning template IDs

Validations:

  • Must be an array of any type

organization[domain_ids]
optional , nil allowed

Domain IDs

Validations:

  • Must be an array of any type

organization[realm_ids]
optional , nil allowed

Realm IDs

Validations:

  • Must be an array of any type

organization[hostgroup_ids]
optional , nil allowed

Host group IDs

Validations:

  • Must be an array of any type

organization[environment_ids]
optional , nil allowed

Environment IDs

Validations:

  • Must be an array of any type

organization[subnet_ids]
optional , nil allowed

Subnet IDs

Validations:

  • Must be an array of any type

organization[parent_id]
optional , nil allowed

Parent ID

Validations:

  • Must be a number.

organization[ignore_types]
optional , nil allowed

List of resources types that will be automatically associated

Validations:

  • Must be an array of any type

organization[location_ids]
optional , nil allowed

Associated location IDs

Validations:

  • Must be an array of any type


PUT /api/organizations/:id
Update an organization

Examples

PUT /api/organizations/447626442
{
  "organization": {
    "organization_parameters_attributes": [
      {
        "name": "foo",
        "value": "new_value"
      }
    ]
  }
}
200
{
  "select_all_types": [],
  "description": null,
  "created_at": "2022-09-06 15:12:24 UTC",
  "updated_at": "2022-09-06 15:12:24 UTC",
  "ancestry": null,
  "parent_id": null,
  "parent_name": null,
  "id": 447626442,
  "name": "org469",
  "title": "org469",
  "users": [],
  "smart_proxies": [],
  "subnets": [],
  "compute_resources": [],
  "media": [],
  "ptables": [],
  "provisioning_templates": [],
  "domains": [],
  "realms": [],
  "hostgroups": [],
  "locations": [],
  "hosts_count": 0,
  "parameters": [
    {
      "priority": 10,
      "created_at": "2022-09-06 15:12:24 UTC",
      "updated_at": "2022-09-06 15:12:24 UTC",
      "id": 767575240,
      "name": "foo",
      "parameter_type": "string",
      "value": "new_value"
    }
  ],
  "deprecations": {
    "environments": "Environments got deprecated from this endpoint."
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

organization
required

Validations:

  • Must be a Hash

organization[name]
optional

Validations:

  • Must be a String

organization[description]
optional , nil allowed

Validations:

  • Must be a String

organization[user_ids]
optional , nil allowed

User IDs

Validations:

  • Must be an array of any type

organization[smart_proxy_ids]
optional , nil allowed

Smart proxy IDs

Validations:

  • Must be an array of any type

organization[compute_resource_ids]
optional , nil allowed

Compute resource IDs

Validations:

  • Must be an array of any type

organization[medium_ids]
optional , nil allowed

Medium IDs

Validations:

  • Must be an array of any type

organization[ptable_ids]
optional , nil allowed

Partition template IDs

Validations:

  • Must be an array of any type

organization[provisioning_template_ids]
optional , nil allowed

Provisioning template IDs

Validations:

  • Must be an array of any type

organization[domain_ids]
optional , nil allowed

Domain IDs

Validations:

  • Must be an array of any type

organization[realm_ids]
optional , nil allowed

Realm IDs

Validations:

  • Must be an array of any type

organization[hostgroup_ids]
optional , nil allowed

Host group IDs

Validations:

  • Must be an array of any type

organization[environment_ids]
optional , nil allowed

Environment IDs

Validations:

  • Must be an array of any type

organization[subnet_ids]
optional , nil allowed

Subnet IDs

Validations:

  • Must be an array of any type

organization[parent_id]
optional , nil allowed

Parent ID

Validations:

  • Must be a number.

organization[ignore_types]
optional , nil allowed

List of resources types that will be automatically associated

Validations:

  • Must be an array of any type

organization[location_ids]
optional , nil allowed

Associated location IDs

Validations:

  • Must be an array of any type

id
required

Validations:

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


DELETE /api/organizations/:id
Delete an organization

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

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