Skip to content

Latest commit

 

History

History
449 lines (310 loc) · 15 KB

File metadata and controls

449 lines (310 loc) · 15 KB

okta.RealmApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
create_realm POST /api/v1/realms Create a realm
delete_realm DELETE /api/v1/realms/{realmId} Delete a realm
get_realm GET /api/v1/realms/{realmId} Retrieve a realm
list_realms GET /api/v1/realms List all realms
replace_realm PUT /api/v1/realms/{realmId} Replace the realm profile

create_realm

Realm create_realm(body)

Create a realm

Creates a new realm

Example

  • Api Key Authentication (apiToken):
  • OAuth Authentication (oauth2):
import okta
from okta.models.create_realm_request import CreateRealmRequest
from okta.models.realm import Realm
from okta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://subdomain.okta.com
# See configuration.py for a list of all supported configuration parameters.
configuration = okta.Configuration(
    host = "https://subdomain.okta.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiToken
configuration.api_key['apiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiToken'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with okta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = okta.RealmApi(api_client)
    body = okta.CreateRealmRequest() # CreateRealmRequest | 

    try:
        # Create a realm
        api_response = api_instance.create_realm(body)
        print("The response of RealmApi->create_realm:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RealmApi->create_realm: %s\n" % e)

Parameters

Name Type Description Notes
body CreateRealmRequest

Return type

Realm

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
429 Too Many Requests -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_realm

delete_realm(realm_id)

Delete a realm

Deletes a realm permanently. This operation can only be performed after disassociating other entities like users and identity providers from a realm.

Example

  • Api Key Authentication (apiToken):
  • OAuth Authentication (oauth2):
import okta
from okta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://subdomain.okta.com
# See configuration.py for a list of all supported configuration parameters.
configuration = okta.Configuration(
    host = "https://subdomain.okta.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiToken
configuration.api_key['apiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiToken'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with okta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = okta.RealmApi(api_client)
    realm_id = 'vvrcFogtKCrK9aYq3fgV' # str | ID of the realm

    try:
        # Delete a realm
        api_instance.delete_realm(realm_id)
    except Exception as e:
        print("Exception when calling RealmApi->delete_realm: %s\n" % e)

Parameters

Name Type Description Notes
realm_id str ID of the realm

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_realm

Realm get_realm(realm_id)

Retrieve a realm

Retrieves a realm

Example

  • Api Key Authentication (apiToken):
  • OAuth Authentication (oauth2):
import okta
from okta.models.realm import Realm
from okta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://subdomain.okta.com
# See configuration.py for a list of all supported configuration parameters.
configuration = okta.Configuration(
    host = "https://subdomain.okta.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiToken
configuration.api_key['apiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiToken'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with okta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = okta.RealmApi(api_client)
    realm_id = 'vvrcFogtKCrK9aYq3fgV' # str | ID of the realm

    try:
        # Retrieve a realm
        api_response = api_instance.get_realm(realm_id)
        print("The response of RealmApi->get_realm:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RealmApi->get_realm: %s\n" % e)

Parameters

Name Type Description Notes
realm_id str ID of the realm

Return type

Realm

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_realms

List[Realm] list_realms(limit=limit, after=after, search=search, sort_by=sort_by, sort_order=sort_order)

List all realms

Lists all realms. > Note: The search parameter results are sourced from an eventually consistent datasource and may not reflect the latest information.

Example

  • Api Key Authentication (apiToken):
  • OAuth Authentication (oauth2):
import okta
from okta.models.realm import Realm
from okta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://subdomain.okta.com
# See configuration.py for a list of all supported configuration parameters.
configuration = okta.Configuration(
    host = "https://subdomain.okta.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiToken
configuration.api_key['apiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiToken'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with okta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = okta.RealmApi(api_client)
    limit = 200 # int | Specifies the number of results returned. Defaults to 10 if `search` is provided. (optional) (default to 200)
    after = 'after_example' # str | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination) and [Link header](https://developer.okta.com/docs/api/#link-header). (optional)
    search = 'search_example' # str | Searches for realms with a supported filtering expression for most properties.  Searches for realms can be filtered by the contains (`co`) operator. You can only use `co` with the `profile.name` property. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)
    sort_by = 'profile.name' # str | Specifies the field to sort by and can be any single property (for search queries only) (optional)
    sort_order = 'asc' # str | Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional) (default to 'asc')

    try:
        # List all realms
        api_response = api_instance.list_realms(limit=limit, after=after, search=search, sort_by=sort_by, sort_order=sort_order)
        print("The response of RealmApi->list_realms:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RealmApi->list_realms: %s\n" % e)

Parameters

Name Type Description Notes
limit int Specifies the number of results returned. Defaults to 10 if `search` is provided. [optional] [default to 200]
after str The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination and Link header. [optional]
search str Searches for realms with a supported filtering expression for most properties. Searches for realms can be filtered by the contains (`co`) operator. You can only use `co` with the `profile.name` property. See Operators. [optional]
sort_by str Specifies the field to sort by and can be any single property (for search queries only) [optional]
sort_order str Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. [optional] [default to 'asc']

Return type

List[Realm]

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
429 Too Many Requests -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace_realm

Realm replace_realm(realm_id, body)

Replace the realm profile

Replaces the realm profile

Example

  • Api Key Authentication (apiToken):
  • OAuth Authentication (oauth2):
import okta
from okta.models.realm import Realm
from okta.models.update_realm_request import UpdateRealmRequest
from okta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://subdomain.okta.com
# See configuration.py for a list of all supported configuration parameters.
configuration = okta.Configuration(
    host = "https://subdomain.okta.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiToken
configuration.api_key['apiToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiToken'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with okta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = okta.RealmApi(api_client)
    realm_id = 'vvrcFogtKCrK9aYq3fgV' # str | ID of the realm
    body = okta.UpdateRealmRequest() # UpdateRealmRequest | 

    try:
        # Replace the realm profile
        api_response = api_instance.replace_realm(realm_id, body)
        print("The response of RealmApi->replace_realm:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RealmApi->replace_realm: %s\n" % e)

Parameters

Name Type Description Notes
realm_id str ID of the realm
body UpdateRealmRequest

Return type

Realm

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

[Back to top] [Back to API list] [Back to Model list] [Back to README]