GET /api/realms
List of realms

Examples

GET /api/realms
200
{
  "total": 4,
  "subtotal": 4,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "name": "myrealm.net",
      "realm_type": "FreeIPA",
      "created_at": "2018-11-15 19:01:27 UTC",
      "updated_at": "2018-11-15 19:01:27 UTC",
      "id": 664044182,
      "realm_proxy_id": 982965213,
      "realm_proxy_name": "Realm Proxy",
      "realm_proxy": {
        "name": "Realm Proxy",
        "id": 982965213,
        "url": "http://else.where:1337"
      }
    },
    {
      "name": "unused.net",
      "realm_type": "FreeIPA",
      "created_at": "2018-11-15 19:01:27 UTC",
      "updated_at": "2018-11-15 19:01:27 UTC",
      "id": 90728897,
      "realm_proxy_id": 982965213,
      "realm_proxy_name": "Realm Proxy",
      "realm_proxy": {
        "name": "Realm Proxy",
        "id": 982965213,
        "url": "http://else.where:1337"
      }
    },
    {
      "name": "useless.net",
      "realm_type": "FreeIPA",
      "created_at": "2018-11-15 19:01:27 UTC",
      "updated_at": "2018-11-15 19:01:27 UTC",
      "id": 229305443,
      "realm_proxy_id": 982965213,
      "realm_proxy_name": "Realm Proxy",
      "realm_proxy": {
        "name": "Realm Proxy",
        "id": 982965213,
        "url": "http://else.where:1337"
      }
    },
    {
      "name": "yourrealm.net",
      "realm_type": "FreeIPA",
      "created_at": "2018-11-15 19:01:27 UTC",
      "updated_at": "2018-11-15 19:01:27 UTC",
      "id": 936160439,
      "realm_proxy_id": 982965213,
      "realm_proxy_name": "Realm Proxy",
      "realm_proxy": {
        "name": "Realm Proxy",
        "id": 982965213,
        "url": "http://else.where:1337"
      }
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
optional

paginate results

Validations:

  • Must be a String

per_page
optional

number of entries per request

Validations:

  • Must be a String

Search fields

Field name Type Possible values
location string
location_id integer
name string
organization string
organization_id integer
type string

GET /api/realms/:id
Show a realm

Examples

GET /api/realms/myrealm.net
200
{
  "name": "myrealm.net",
  "realm_type": "FreeIPA",
  "created_at": "2018-11-15 19:01:27 UTC",
  "updated_at": "2018-11-15 19:01:27 UTC",
  "id": 664044182,
  "realm_proxy_id": 982965213,
  "realm_proxy_name": "Realm Proxy",
  "realm_proxy": {
    "name": "Realm Proxy",
    "id": 982965213,
    "url": "http://else.where:1337"
  },
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

id
required

Numerical ID or realm name

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/realms
Create a realm

The name field is used for the name of the realm.

Examples

POST /api/realms
{
  "realm": {
    "name": "realm.net",
    "realm_proxy_id": "982965213-Realm Proxy",
    "realm_type": "FreeIPA"
  }
}
201
{
  "name": "realm.net",
  "realm_type": "FreeIPA",
  "created_at": "2018-11-15 19:01:57 UTC",
  "updated_at": "2018-11-15 19:01:57 UTC",
  "id": 936160440,
  "realm_proxy_id": 982965213,
  "realm_proxy_name": "Realm Proxy",
  "realm_proxy": {
    "name": "Realm Proxy",
    "id": 982965213,
    "url": "http://else.where:1337"
  },
  "locations": [],
  "organizations": []
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

realm
required

Validations:

  • Must be a Hash

realm[name]
required

The realm name, e.g. EXAMPLE.COM

Validations:

  • Must be a String

realm[realm_proxy_id]
required , nil allowed

Proxy ID to use within this realm

Validations:

  • Must be a number.

realm[realm_type]
required

Realm type, e.g. FreeIPA or Active Directory

Validations:

  • Must be a String

realm[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

realm[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/realms/:id
Update a realm

Examples

PUT /api/realms/myrealm.net
{
  "realm": {
    "name": ""
  }
}
422
{
  "error": {
    "id": 664044182,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

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.

realm
required

Validations:

  • Must be a Hash

realm[name]
optional

The realm name, e.g. EXAMPLE.COM

Validations:

  • Must be a String

realm[realm_proxy_id]
optional , nil allowed

Proxy ID to use within this realm

Validations:

  • Must be a number.

realm[realm_type]
optional

Realm type, e.g. FreeIPA or Active Directory

Validations:

  • Must be a String

realm[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

realm[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/realms/:id
Delete a realm

Examples

DELETE /api/realms/myrealm.net
{
  "realm": {}
}
200
{
  "id": 664044182,
  "name": "myrealm.net",
  "realm_type": "FreeIPA",
  "realm_proxy_id": 982965213,
  "created_at": "2018-11-15T19:01:27.670Z",
  "updated_at": "2018-11-15T19:01:27.670Z"
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

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.