Skip to main content

Kerberos Server Profile

The KerberosServerProfile service manages Kerberos server profile objects in Strata Cloud Manager, defining Kerberos Key Distribution Center (KDC) servers used for authentication.

Class Overview

The KerberosServerProfile class provides CRUD operations for Kerberos server profile objects. It is accessed through the client.kerberos_server_profile attribute on an initialized Scm instance.

from scm.client import Scm

client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

# Access the KerberosServerProfile service
kerberos_profiles = client.kerberos_server_profile

Key Attributes

AttributeTypeRequiredDescription
namestrYesProfile name
idUUIDYes*Unique identifier (*response only)
serverList[KerberosServer]NoList of Kerberos servers
folderstrNo*Folder location
snippetstrNo*Snippet location
devicestrNo*Device location

* Exactly one of folder, snippet, or device is required.

Methods

List Kerberos Server Profiles

Retrieves a list of Kerberos server profile objects with optional filtering.

# List all Kerberos server profiles in a folder
profiles = client.kerberos_server_profile.list(folder="Texas")

for profile in profiles:
print(f"Name: {profile.name}")

Parameters:

ParameterTypeRequiredDescription
folderstrNo*Folder in which the resource is defined
snippetstrNo*Snippet in which the resource is defined
devicestrNo*Device in which the resource is defined
exact_matchboolNoOnly return objects exactly in the container
exclude_foldersList[str]NoList of folders to exclude
exclude_snippetsList[str]NoList of snippets to exclude
exclude_devicesList[str]NoList of devices to exclude

* Exactly one of folder, snippet, or device is required.

Fetch a Kerberos Server Profile

Retrieves a single Kerberos server profile by name and container.

# Fetch a specific Kerberos server profile by name
profile = client.kerberos_server_profile.fetch(
name="corp-kerberos",
folder="Texas"
)

print(f"Name: {profile.name}, ID: {profile.id}")

Parameters:

ParameterTypeRequiredDescription
namestrYesThe name of the Kerberos server profile
folderstrNo*Folder in which the resource is defined
snippetstrNo*Snippet in which the resource is defined
devicestrNo*Device in which the resource is defined

* Exactly one of folder, snippet, or device is required.

Create a Kerberos Server Profile

Creates a new Kerberos server profile object.

# Create a new Kerberos server profile
profile = client.kerberos_server_profile.create({
"name": "corp-kerberos",
"folder": "Texas",
"server": [
{
"name": "kdc-primary",
"host": "kdc.example.com",
"port": 88
}
]
})

print(f"Created profile: {profile.name} (ID: {profile.id})")

Parameters:

ParameterTypeRequiredDescription
dataDict[str, Any]YesDictionary containing the profile configuration

Update a Kerberos Server Profile

Updates an existing Kerberos server profile object.

# Fetch, modify, update
profile = client.kerberos_server_profile.fetch(name="corp-kerberos", folder="Texas")
profile.server = [
{"name": "kdc-primary", "host": "kdc1.example.com", "port": 88},
{"name": "kdc-secondary", "host": "kdc2.example.com", "port": 88}
]
updated = client.kerberos_server_profile.update(profile)

print(f"Updated profile: {updated.name}")

Delete a Kerberos Server Profile

Deletes a Kerberos server profile object by ID.

# Delete by ID
client.kerberos_server_profile.delete("abcd1234-5678-9abc-def0-123456789abc")

Parameters:

ParameterTypeRequiredDescription
object_idstrYesThe UUID of the profile to delete

Use Cases

Multiple KDC Servers

# Create a profile with primary and backup KDC servers
profile = client.kerberos_server_profile.create({
"name": "corp-kerberos-ha",
"folder": "Texas",
"server": [
{
"name": "kdc-primary",
"host": "kdc1.example.com",
"port": 88
},
{
"name": "kdc-backup",
"host": "kdc2.example.com",
"port": 88
}
]
})

Bulk Profile Management

# List and audit all Kerberos server profiles
profiles = client.kerberos_server_profile.list(
folder="Texas",
exact_match=True
)

for profile in profiles:
server_count = len(profile.server) if profile.server else 0
print(f"Profile: {profile.name}, Servers: {server_count}")

Error Handling

from scm.exceptions import InvalidObjectError, MissingQueryParameterError

try:
profile = client.kerberos_server_profile.fetch(
name="corp-kerberos",
folder="Texas"
)
except MissingQueryParameterError as e:
print(f"Missing parameter: {e.message}")
except InvalidObjectError as e:
print(f"Invalid object: {e.message}")
except Exception as e:
print(f"Unexpected error: {e}")