org.keycloak.services.resources.admin

## Class RealmsAdminResource

- java.lang.Object
- - org.keycloak.services.resources.admin.RealmsAdminResource

-     public class RealmsAdminResource
      extends Object

  Top level resource for Admin REST API
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdminAuth` | `auth`
    `protected ClientConnection` | `clientConnection`
    `protected static org.jboss.logging.Logger` | `logger`
    `static javax.ws.rs.core.CacheControl` | `noCache`
    `protected KeycloakSession` | `session`
    `protected TokenManager` | `tokenManager`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmsAdminResource(AdminAuth auth, TokenManager tokenManager)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RealmAdminResource` | `getRealmAdmin(javax.ws.rs.core.HttpHeaders headers, String name)` Base path for the admin REST API for one particular realm.
    `Stream<RealmRepresentation>` | `getRealms()` Get accessible realms Returns a list of accessible realms.
    `javax.ws.rs.core.Response` | `importRealm(RealmRepresentation rep)` Import a realm Imports a realm from a full representation of that realm.
    `protected RealmRepresentation` | `toRealmRep(RealmModel realm)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### auth

          protected AdminAuth auth

    - #### tokenManager

          protected TokenManager tokenManager

    - #### session

          @Context
          protected KeycloakSession session

    - #### clientConnection

          @Context
          protected ClientConnection clientConnection

    - #### noCache

          public static final javax.ws.rs.core.CacheControl noCache

  - ### Constructor Detail

    - #### RealmsAdminResource

          public RealmsAdminResource(AdminAuth auth,
                                     TokenManager tokenManager)

  - ### Method Detail

    - #### getRealms

          @GET
           @Produces(value="application/json")
          public Stream<RealmRepresentation> getRealms()

      Get accessible realms Returns a list of accessible realms. The list is filtered based on what realms the caller is allowed to view.
      Returns:

    - #### toRealmRep

          protected RealmRepresentation toRealmRep(RealmModel realm)

    - #### importRealm

          @POST
           @Consumes(value="application/json")
          public javax.ws.rs.core.Response importRealm(RealmRepresentation rep)

      Import a realm Imports a realm from a full representation of that realm. Realm name must be unique.
      Parameters:
        `rep` - JSON representation of the realm
      Returns:

    - #### getRealmAdmin

          @Path(value="{realm}")
          public RealmAdminResource getRealmAdmin(@Context
                                                                         javax.ws.rs.core.HttpHeaders headers,
                                                                         @PathParam(value="realm")
                                                                         String name)

      Base path for the admin REST API for one particular realm.
      Parameters:
        `headers` -
        `name` - realm name (not id!)
      Returns:

Copyright © 2021 JBoss by Red Hat. All rights reserved.